UGC NET Paper 2 (Computer Science)Hard
Keys 30, 10, 20 are inserted in this order into an empty AVL tree. The rebalancing needed and the resulting root are:
- A. Single right rotation, root 10
- B. Left-right double rotation, root 20
- C. Single left rotation, root 30
- D. Right-left double rotation, root 20
Correct answer: B. Left-right double rotation, root 20
30 with left child 10 and 10's right child 20 is a left-right case; after rotations 20 is the root.
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
- The number of distinct binary search trees on keys 1 to 4 is:
- Strassen's matrix multiplication has time complexity approximately:
- The language {a^n b^n | n >= 0} is:
- A graph has 13 vertices, 17 edges and is connected. Its cyclomatic number (number of independent cycles) is:
- The Floyd cycle-detection (tortoise and hare) method finds a cycle in a linked list using:
- For the reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1 and 3 frames, the number of page faults under LRU is: