Fenwick Tree Usage Patterns and Classic Problem Solutions
1. Single-Point Update with Prefix Sum Query Maintain a sequence of n numbers. Support q operations: update an element to a new value, or compute the prefix sum up to a given index. Construct a Fenwick tree over the index range [1, n]. On udpate, compute the delta and apply it to both the raw array...