1.

What maximum difference in heights between the leafs of a AVL tree is possible?(a) log(n) where n is the number of nodes(b) n where n is the number of nodes(c) 0 or 1(d) atmost 1My doubt is from AVL Tree in section Binary Trees of Data Structures & Algorithms IThis question was posed to me in an interview.

Answer»

Correct choice is (a) LOG(n) where n is the number of nodes

To EXPLAIN: At every level we can form a TREE with difference in HEIGHT between subtrees to be ATMOST 1 and so there can be log(n) such levels since height of AVL tree is log(n).



Discussion

No Comment Found

Related InterviewSolutions