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

In a segment tree, what does each node store?

In a segment tree, what does each node store?

  1. A.One array element only
  2. B.The index of the largest element
  3. C.The answer (for example the sum) for one continuous range of the array
  4. D.A pointer to the next node in order
Answer & explanation

Correct answer: The answer (for example the sum) for one continuous range of the array

The root covers the whole array and each child covers half of its parent's range.

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 →