The start
parameter represents the starting index of the segment covered
by this node in a segment tree.
The end
parameter represents the end index of the segment covered by this
node in a segment tree.
The sum
parameter represents the sum of the values in the range covered by
the segment tree node.
Optional
value: numberThe value
parameter is an optional parameter
of type SegmentTreeNodeVal
. It represents the value associated with the segment tree node.
The function returns the value of the protected variable _end
.
The value of the protected property _end
.
The above function sets the value of the "end" property.
The value parameter is a number that represents the new value for the end property.
The function returns the left child of a segment tree node.
The left
property of the SegmentTreeNode
object is being returned. It is of type
SegmentTreeNode
or undefined
.
The function sets the value of the left property of a SegmentTreeNode object.
The value parameter is of type SegmentTreeNode or undefined.
The function returns the right child of a segment tree node.
The getRight()
method is returning a value of type SegmentTreeNode
or undefined
.
The function sets the right child of a segment tree node.
The value
parameter is of type SegmentTreeNode | undefined
. This means that it can accept either a SegmentTreeNode
object or undefined
as its
value.
The function returns the value of the protected variable _start.
The start value, which is of type number.
The above function sets the value of the "start" property.
The value parameter is of type number.
The function returns the value of the sum property.
The method is returning the value of the variable _sum
.
The above function sets the value of the sum property.
The parameter "value" is of type "number".
The function returns the value of a segment tree node.
The value being returned is either a SegmentTreeNodeVal
object or undefined
.
The function sets the value of a segment tree node.
The value
parameter is of type
SegmentTreeNodeVal
or undefined
.
The constructor initializes the properties of a SegmentTreeNode object.