For a tree with just one node, the root node is the height of a binary tree is defined to zero; if there are 2 levels of nodes, the height is 1 and so on.
For a tree with just one node, the root node is the height of a binary tree is defined to zero; if there are 2 levels of nodes, the height is 1 and so on.
A Binary Search Tree is built according to the usual rules with the following six key inserted one at a time as given :
B, I, N, A, R, Y. What is the height of the tree?
Show answerHide answer
Correct answer: (D) 4
Explanation
Inserting B, I, N, A, R, Y gives root B with A on the left and the chain I → N → R → Y to the right. The longest path B-I-N-R-Y has 4 edges, so the height is 4.