All mock tests are FREE till 31 December — register to save your progress

Given below are two statements: one is labelled as Assertion A and the other is labelled as Reason R.
Assertion A: AVL trees are more balanced than red-black trees, but they may cause more rotations during insertion and deletion.
Reason R: A red-black tree with n nodes has height greater than 2 log₂(n + 1), and an AVL tree with n nodes has height less than log_φ(√5 (n + 2)) − 2 (where φ is the golden ratio).

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. A is true but R is false

Explanation

A is true. R is false: a red-black tree's height is at most 2 log₂(n + 1), not greater than it.

More Data Structures and Algorithms questions