pub fn update<T>(fenwick: &mut [T], i: usize, delta: T)where
    T: AddAssign + Copy + Default,
Expand description

Updates one element in the Fenwick tree stored in a borrowed slice (zero-based).

Conceptually performs a[i] += delta on the original array a.

Panics

Panics if fenwick[i] is out of bound.

Examples

See module-level example.