Sunday, October 5, 2025
HomeData Modelling & AIData Structures | Balanced Binary Search Trees | Question 4

Data Structures | Balanced Binary Search Trees | Question 4

Which of the following is AVL Tree?

A
        100
     /      \
    50       200
   /           \
 10            300


B
           100
       /       \
     50        200
    /        /     \
  10       150     300
 /
5


C
            100
       /          \
     50            200
    /  \          /     \
  10    60       150     300
 /                 \        \
5                   180       400

(A) Only A
(B) A and C
(C) A, B and C
(D) Only B

Answer: (B)
Explanation: A Binary Search Tree is AVL if balance factor of every node is either -1 or 0 or 1. Balance factor of a node X is [(height of X->left) – (height of X->right)].

In Tree B, the node with value 50 has balance factor 2. That is why B is not an AVL tree.
Quiz of this Question

Feeling lost in the world of random DSA topics, wasting time without progress? It’s time for a change! Join our DSA course, where we’ll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!

RELATED ARTICLES

Most Popular

Dominic
32337 POSTS0 COMMENTS
Milvus
86 POSTS0 COMMENTS
Nango Kala
6706 POSTS0 COMMENTS
Nicole Veronica
11871 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11934 POSTS0 COMMENTS
Shaida Kate Naidoo
6821 POSTS0 COMMENTS
Ted Musemwa
7087 POSTS0 COMMENTS
Thapelo Manthata
6779 POSTS0 COMMENTS
Umr Jansen
6778 POSTS0 COMMENTS