Balance factor of any node of an AVL tree - Data Structure

Q.  Data Structure: Which amongst the following cannot be a balance factor of any node of an AVL tree?
- Published on 19 Oct 15

a. 0
b. 1
c. –1
d. 2

ANSWER: 2
 

    Discussion

  • Nihal   -Posted on 01 Apr 16
    According to given question, 2 cannot be a balance factor of any node of an AVL tree. AVL tree is also called as balanced binary search tree. Each node of an AVL tree has a balance factor.

    The balance factor of a binary tree is the difference in heights of its two subtrees (Left and right subtree). The balance factor of a height balanced binary tree may take one of the values -1, 0, +1.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)