← 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]?
- A.Returns its stored value without going deeper
- B.Returns 0
- C.Splits into its two children
- 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 →