Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Data Structures | Balanced Binary Search Trees | Question 13

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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 trees 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
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads
Related Tutorials