algorithm - Sort alphabet letters using a Binary tree -


i came across interview question states: how represent letters a, b, c, d, e, f , g in sorted order using binary tree representation?

it's stumped me. if take g root of tree left child e , right child f right subtree "greater than" left subtree. node e, left child , right child b , f's left child c , right child d.

is correct or else have different answer?

the binary tree described binary heap, used implement priority queue.

instead, use binary search tree, keeps keys in sorted order.


Comments

Popular posts from this blog

json - Zend error Connection -

javascript - Trigger mouseenter when an animated element touches mouse -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -