dastal - v5.0.0 / SegmentTree
Name |
---|
T |
-
Collection<T>
↳ SegmentTree
• Readonly
size: number
The number of elements in the collection.
src/collection/collection.ts:5
▸ [iterator](): Iterator
<T, any, undefined>
Iterator
<T, any, undefined>
node_modules/typescript/lib/lib.es2015.iterable.d.ts:51
▸ clear(): void
Removes all elements.
void
src/segmentTree/segmentTree.ts:7
▸ pop(): undefined
| T
Retrieves and removes the last element
undefined
| T
The last element or undefined
if empty.
src/segmentTree/segmentTree.ts:13
▸ push(element
): number
Appends an element to the tree
Name | Type | Description |
---|---|---|
element |
T |
The element to be inserted |
number
The new size of the tree
src/segmentTree/segmentTree.ts:21
▸ query(min
, max
): T
Get the aggregated result of a given range in the tree
Name | Type | Description |
---|---|---|
min |
number |
The start index of the range, inclusive |
max |
number |
The end index of the range, exclusive |
T
The aggregated result for range [min, max)
src/segmentTree/segmentTree.ts:30
▸ update(min
, max
, operation
): void
Update the elements of a given range in the tree
Name | Type | Description |
---|---|---|
min |
number |
The start index of the range, inclusive |
max |
number |
The end index of the range, exclusive |
operation |
(element : T , index : number ) => T |
The update to perform |
void