Fenwick trees for prefix sums and updates · 2 of 3 Advanced
Range update, point query
Add to a whole range and read one value, by keeping a difference array in a Fenwick tree.
Books1
Links2
- Fenwick Tree Range update with point query by the same two writes, then range update with range sum using two trees. cp-algorithms.com (opens in a new tab)
- Range Update Range Query Range additions with range sums, first with two binary indexed trees and then with a lazy segment tree. usaco.guide (opens in a new tab)