Skip to content

UGC NET CS 2023Data Structures and Algorithms › Data StructuresVerified

UGC NET CS 2023 PYQ: Given below are two statements: one is labelled as Assertion $\mathrm{A}$ and the other is labelled as…

Given below are two statements: one is labelled as Assertion $\mathrm{A}$ and the other is labelled as Reason $\mathrm{R}$.

Assertion $\mathrm{A}$: The AVL trees are more balanced as compared to Red Black trees, but they may cause more rotations during insertion and deletion

Reason $\mathrm{R}$: A Red Black tree with n nodes has height that is greater than $2 \log _{2}(n+1)$ and the AVL tree with n nodes has height less than $\log _{\Phi}(\sqrt{5}(n+2))-2$ (where $\Phi$ is golden ratio)

In the light of the above statements, choose the correct answer from the options given below.

  1. A
    Both $\mathrm{A}$ and $\mathrm{R}$ are correct and $\mathrm{R}$ is the correct explanation of $\mathrm{A}$
  2. B
    Both $\mathrm{A}$ and $\mathrm{R}$ are correct and $\mathrm{R}$ is NOT the correct explanation of $\mathrm{A}$
  3. C
    $\mathrm{A}$ is true but $\mathrm{R}$ is false
    Correct answer
  4. D
    $\mathrm{A}$ is false but $\mathrm{R}$ is true

Answer

(C) $\mathrm{A}$ is true but $\mathrm{R}$ is false

Approach

Check the balance properties of AVL and Red-Black trees and the stated height bounds.

Reviewed by UGC IQ Editorial Team.