pub struct FenwickTree<T: Default + Ord, Op: PrefixOp<T>> { /* private fields */ }
Expand description

Max Bit Tree. get(i) will return the largest element e that has been added to the bit tree with set(j, e), where j <= i. Initially all positions have the value T::default(). Note that a set cannot be ‘undone’ by inserting a smaller element at the same index.

Implementations

Create a new bit tree with len elements

get(i) returns the largest element e that has been added to the bit tree with set(j, e), where j <= i.

Set the value val at position idx. val will be returned for any get(j) where j >= idx, if it is the maximum value inserted between 0 and j. Inserting a value val2 after inserting val1 where val1 > val2

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.