← Quiz: Segment Tree and Fenwick Tree: all 10 questions
Quiz: Segment Tree and Fenwick Tree · Question 10 of 10
When is a segment tree a better choice than a Fenwick tree?
When is a segment tree a better choice than a Fenwick tree?
- A.When the array never changes
- B.When you only need prefix sums
- C.When memory must be as small as possible
- D.When you need range minimum or maximum with updates
Answer & explanation
Correct answer: When you need range minimum or maximum with updates
A Fenwick tree handles sums easily, but min and max over any range need a segment tree.
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 →