🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.0
  2. B.−1
  3. C.Infinity (a value larger than every element)
  4. 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 →