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: The AVL trees are more balanced as compared to Red Black trees, but they may cause more rotations during insertion and deletion

Reason R: A Red Black tree with n nodes has 2 log (n + 1) height that is greater than 2 and the AVL tree with n nodes has height less than – log (√5(n + 2)) − 2( Φ Φ where is golden ratio) In the light of the above statements, choose the correct answer from the options given below.

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

AVL trees are more strictly balanced and may rotate more on updates (A true). A red-black tree's height is at most 2 lg(n + 1), not greater than it, so R is false.

More Data Structures and Algorithms questions