class FenwickTree(T)
- FenwickTree(T)
- Reference
- Object
Defined in:
datastructure/fenwick_tree.crConstructors
Instance Method Summary
-
#[](start : Int, count : Int) : T
Returns sum of
a[start, count]
-
#[](index : Int)
Returns index th element.
-
#[](range : Range) : T
Returns sum of
a[range]
-
#[]=(index : Int, x) : Nil
Set x to index th element.
-
#add(index : Int, x) : Nil
Adds x to index th element.
-
#left_sum(i : Int) : T
Culculates sum of
a[0...i]
. -
#set(index : Int, x) : Nil
Set x to index th element.
- #size : Int32
-
#to_a : Array(T)
Returns the elements as an Array.