UGC NET Paper 2 (Computer Science)Very hard
The maximum possible height of a red-black tree with n internal nodes is:
- A. 2 log2(n+1)
- B. log2(n+1)
- C. 2 log2 n - 1
- 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).
Practise more UGC NET Computer Science and Applications questionsUGC NET Computer Science and Applications: notes and key points
More UGC NET Computer Science and Applications questions
- In a B-tree with minimum degree t (t >= 2), every node other than the root must contain at least:
- The amortized time complexity of an operation (search, insert or delete) on a splay tree with n nodes is:
- The minimum number of states in a DFA over {0, 1} accepting exactly the strings that end with 00 is:
- Which statement about pushdown automata acceptance modes is correct?
- Given a grammar in Chomsky Normal Form, the CYK algorithm decides whether a string of length n belongs to the language in time:
- Which of the following problems is undecidable in general?