Struct competitive_programming_rs::data_structure::fenwick_tree::FenwickTree[][src]

pub struct FenwickTree<T> { /* fields omitted */ }

FenwickTree is a data structure that can efficiently update elements and calculate prefix sums in a table of numbers. https://en.wikipedia.org/wiki/Fenwick_tree

Methods

impl<T: Copy + AddAssign + Sub<Output = T>> FenwickTree<T>
[src]

Constructs a new FenwickTree. The size of FenwickTree should be specified by size.

Returns a sum of range [l, r)

Returns a sum of range [0, k)

Auto Trait Implementations

impl<T> Send for FenwickTree<T> where
    T: Send

impl<T> Sync for FenwickTree<T> where
    T: Sync