UGC NET Paper 2 (Computer Science)Very hard

The maximum possible height of a red-black tree with n internal nodes is:

  1. A. 2 log2(n+1)
  2. B. log2(n+1)
  3. C. 2 log2 n - 1
  4. D. log2 n

Correct answer: A. 2 log2(n+1)

The black-height property forces every root-to-leaf path to have at least half the black nodes of the longest path, giving the bound height <= 2 log2(n+1).

More UGC NET Computer Science and Applications questions

Exams that ask this topic