Q. How does a Red-Black tree ensure balance after deletion?
-
A.
By performing rotations and recoloring.
-
B.
By deleting the node and not balancing.
-
C.
By merging nodes.
-
D.
By increasing the height of the tree.
Solution
After deletion in a Red-Black tree, balance is restored through a combination of rotations and recoloring.
Correct Answer:
A
— By performing rotations and recoloring.
Learn More →
Q. Which traversal method can be used to obtain a sorted order of elements in an AVL tree?
-
A.
In-order traversal
-
B.
Pre-order traversal
-
C.
Post-order traversal
-
D.
Level-order traversal
Solution
In-order traversal of an AVL tree will yield the elements in sorted order.
Correct Answer:
A
— In-order traversal
Learn More →
Showing 1 to 2 of 2 (1 Pages)