🎙 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 3 of 10

During a query, what does a node do if its range is completely inside [L..R]?

During a query, what does a node do if its range is completely inside [L..R]?

  1. A.Returns its stored value without going deeper
  2. B.Returns 0
  3. C.Splits into its two children
  4. D.Updates itself
Answer & explanation

Correct answer: Returns its stored value without going deeper

This early stop is what keeps a query at O(log n) nodes.

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 →