Open In App

Data Structures | Balanced Binary Search Trees | Question 2

Like Article
Like
Save Article
Save
Share
Report issue
Report

What is the maximum height of any AVL-tree with 7 nodes? Assume that the height of a tree with a single node is 0.

(A) 2
(B) 3
(C) 4
(D) 5


Answer: (B)

Explanation: AVL trees are binary trees with the following restrictions.
1) the height difference of the children is at most 1.
2) both children are AVL trees

Following is the most unbalanced AVL tree that we can get with 7 nodes

                 a
               /   \
             /      \
            b        c
          /  \      /
         /    \    /
        d     e   g
       /
      /
     h


Quiz of this Question


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads