Fenwick tree (Binary Indexed Tree)
- Stage
- 6
- Module
- M6.10
- Lessons
- 1
In this module
- Understand how a Fenwick tree stores partial sums with O(log n) operations.
- Implement update and range-sum queries using bit manipulation.
- Apply Fenwick trees to dynamic range-sum problems where prefix sums fail.
Before this module
Lessons
Practice
Try these on the judge. Each link opens the problem on DMOJ.
- 2019 J5Rule of Three (opens on DMOJ in a new tab) DMOJ
Calculate how the number of each item changes across growing inventory.
- 2020 S1Surmising a Sprinter's Speed (opens on DMOJ in a new tab) DMOJ
Work with a sprinter's recorded checkpoint times to find a consistent picture of the race.