pub struct LazySegmentTree<T: LazyNode> { /* private fields */ }
Expand description

Lazy segment tree with range queries and range updates. It uses O(n) space, assuming that each node uses O(1) space.

Implementations

Builds lazy segment tree from slice, each element of the slice will correspond to a leaf of the segment tree. It has time complexity of O(n*log(n)), assuming that combine has constant time complexity.

Updates the range [i,j] with value. It will panic if i or j is not in [0,n). It has time complexity of O(log(n)), assuming that combine, update_lazy_value and update_lazy_value have constant time complexity.

Returns the result from the range [left,right]. It returns None if and only if range is empty. It will panic if left or right are not in [0,n). It has time complexity of O(log(n)), assuming that combine, update_lazy_value and update_lazy_value have constant time complexity.

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

Performs the conversion.

Performs the conversion.

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.