← Quiz: Segment Tree and Fenwick Tree: all 10 questions
Quiz: Segment Tree and Fenwick Tree · Question 2 of 10
In a segment tree, what does each node store?
In a segment tree, what does each node store?
- A.One array element only
- B.The index of the largest element
- C.The answer (for example the sum) for one continuous range of the array
- D.A pointer to the next node in order
Answer & explanation
Correct answer: The answer (for example the sum) for one continuous range of the array
The root covers the whole array and each child covers half of its parent's range.
Can you get the rest right without peeking?
Take the timed Quiz: Segment Tree and Fenwick Tree quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →