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

## Recommended Posts:

- Data Structures | Balanced Binary Search Trees | Question 9
- Data Structures | Balanced Binary Search Trees | Question 13
- Data Structures | Balanced Binary Search Trees | Question 7
- Data Structures | Balanced Binary Search Trees | Question 12
- Data Structures | Balanced Binary Search Trees | Question 13
- Data Structures | Balanced Binary Search Trees | Question 10
- Data Structures | Balanced Binary Search Trees | Question 2
- Data Structures | Balanced Binary Search Trees | Question 11
- Data Structures | Balanced Binary Search Trees | Question 13
- Data Structures | Balanced Binary Search Trees | Question 2
- Data Structures | Balanced Binary Search Trees | Question 5
- Data Structures | Balanced Binary Search Trees | Question 4
- Data Structures | Binary Search Trees | Question 6
- Data Structures | Binary Search Trees | Question 2
- Data Structures | Binary Search Trees | Question 12