Results for “Std.FenwickTree.FenwickTree”
11 matching declarations
Use module:Std.List, kind:fn, or is:exact. Put a Pudu type after ::.
- Std.FenwickTree.FenwickTree
A low-level Binary Indexed Tree for O(log n) prefix sums and point updates.
- Std.FenwickTree.add
&Std.FenwickTree.FenwickTree -> Int -> Int -> Option[Std.FenwickTree.FenwickTree]Adds
deltato the 1-based element atindexin O(log n) time. - Std.FenwickTree.create
Int -> Std.FenwickTree.FenwickTreeAllocates a zero-initialized Fenwick tree for sequence length
elementCount. - Std.FenwickTree.findPrefix
&Std.FenwickTree.FenwickTree -> Int -> Option[Int]Finds the smallest 1-based index whose prefix sum is >=
targetSumin O(log n) time. - Std.FenwickTree.fromArray
&Array[Int] -> Std.FenwickTree.FenwickTreeBuilds a Fenwick tree in strict O(n) linear time from an array of initial values.
- Std.FenwickTree.get
&Std.FenwickTree.FenwickTree -> Int -> Option[Int]Retrieves the single value at 1-based
indexin O(log n) time. - Std.FenwickTree.prefixSum
&Std.FenwickTree.FenwickTree -> Int -> Option[Int]Computes the prefix sum up to 1-based
indexin O(log n) time. - Std.FenwickTree.rangeSum
&Std.FenwickTree.FenwickTree -> Int -> Int -> Option[Int]Computes the range sum [left, right] inclusive in O(log n) time.
- Std.FenwickTree.set
&Std.FenwickTree.FenwickTree -> Int -> Int -> Option[Std.FenwickTree.FenwickTree]Sets the 1-based element at
indextovalue. - Std.FenwickTree.size
&Std.FenwickTree.FenwickTree -> IntReturns the number of elements in the tree.
- Std.FenwickTree.toArray
&Std.FenwickTree.FenwickTree -> Array[Int]Materializes the tree values into a standard 0-indexed array.
