Skip to content
Related Articles

Related Articles

Data Structures | Balanced Binary Search Trees | Question 13
  • Last Updated : 28 Feb, 2013

Which of the following is true
(A) The AVL trees are more balanced compared to Red Black Trees, but they may cause more rotations during insertion and deletion.
(B) Heights of AVL and Red-Black trees are generally same, but AVL Trees may cause more rotations during insertion and deletion.
(C) Red Black trees are more balanced compared to AVL Trees, but may cause more rotations during insertion and deletion.
(D) Heights of AVL and Red-Black trees are generally same, but Red Black rees may cause more rotations during insertion and deletion.


Answer: (A)

Explanation: Red Black Tree with n nodes has height <= 2Log2(n+1)

AVL Tree with n nodes has height less than Logφ(√5(n+2)) – 2.

Therefore, the AVL trees are more balanced compared to Red Black Trees, but they may cause more rotations during insertion and deletion. So if your application involves many frequent insertions and deletions, then Red Black trees should be preferred. And if the insertions and deletions are less frequent and search is more frequent operation, then AVL tree should be preferred over Red Black Tree.

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :