Constructors
constructor
- new SegmentTree(values, start?, end?): SegmentTree
-
Parameters
-
values: number[]
-
Optional
start: number
-
Optional
end: number
Properties
Protected
_end
_end: number
Protected
_start
_start: number = 0
Protected
_values
_values: number[] = []
Methods
querySumByRange
- querySumByRange(indexA, indexB): number
-
Parameters
-
indexA: number
-
indexB: number
Returns number
updateNode
- updateNode(index, sum, val?): void
-
Parameters
-
index: number
-
sum: number
-
Optional
val: number
Returns void