← Quiz: Segment Tree and Fenwick Tree: all 10 questions
Quiz: Segment Tree and Fenwick Tree · Question 7 of 10
In a Fenwick tree, which T entries are added to get prefix(7)?
In a Fenwick tree, which T entries are added to get prefix(7)?
- A.T[7] only
- B.T[1] through T[7]
- C.T[7] and T[8]
- D.T[7], T[6] and T[4]
Answer & explanation
Correct answer: T[7], T[6] and T[4]
Start at 7, then 7 − 1 = 6, then 6 − 2 = 4, then 4 − 4 = 0, where the loop stops.
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 →