I came across an interview question which states: How would you represent the letters , , , , , and in a sorted order using a binary tree representation?
It's really stumped me.
If we take to be the root of the tree then the left child would and the right child would be so that the right subtree is "greater than" the left subtree. Then for the node E, its left child would be A and the right child and 's left child would be and its right child would be .
Is that correct or does anyone else have a different answer?
asked Aug 25 '15 at 0:40
8,36144 gold badges3030 silver badges7575 bronze badges