← Quiz: Segment Tree and Fenwick Tree: all 10 questions
Quiz: Segment Tree and Fenwick Tree · Question 5 of 10
In a segment tree for range minimum, what should a completely outside node return?
In a segment tree for range minimum, what should a completely outside node return?
- A.0
- B.−1
- C.Infinity (a value larger than every element)
- D.The node's own value
Answer & explanation
Correct answer: Infinity (a value larger than every element)
Infinity does not change the minimum. Returning 0 would wrongly make the answer 0.
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 →