Prefix sum
This crate provides an implementation of the prefix sum data structure.
Usage
The use case of this crate is when you want to find the result of combining a large number of interval modifications.
Example code:
use PrefixSum;
let mut sum = new;
// Each of these operations is O(1).
sum += 2;
sum += 3;
sum += 10;
sum += 7;
// The build method is O(len).
assert_eq!;
Cargo.toml
[]
= "0.1"