Advanced
Data Structures & Algorithms
Q92 / 100
What is heavy-light decomposition?
Correct! Well done.
Incorrect.
The correct answer is B) Decomposing a tree into O(log n) chains, enabling range queries on tree paths using a segment tree in O(log² n)
B
Correct Answer
Decomposing a tree into O(log n) chains, enabling range queries on tree paths using a segment tree in O(log² n)
Explanation
HLD decomposes a tree into chains by always following the child with the largest subtree. Any root-to-leaf path crosses O(log n) chains, enabling efficient path queries with a segment tree.
Progress
92/100