The type of data stored in the node.
The type of the family relationship in the binary tree.
The constructor function initializes a new instance of a class with a key and an optional value, and sets the height property to 0.
The "key" parameter is of type K, which represents the type of the key for the constructor. It is used to initialize the key property of the object being created.
Optional
value: VThe "value" parameter is an optional parameter of type V. It represents the value associated with the key in the constructor.
Get the position of the node within its family.
The function returns the value of the height property.
The height of the object.
The above function sets the value of the height property.
The value parameter is a number that represents the new height value to be set.
The function returns the value of the _left
property.
The _left
property of the current object is being returned.
The function sets the left child of a node and updates the parent reference of the child.
The parameter v
is of type NODE | undefined
. It can either be an
instance of the NODE
class or undefined
.
The function returns the right node of a binary tree or undefined if there is no right node.
The method is returning the value of the _right
property, which is of type NODE
or
undefined
.
The function sets the right child of a node and updates the parent reference of the child.
The parameter v
is of type NODE | undefined
. It can either be a
NODE
object or undefined
.
Generated using TypeDoc
Represents a node in a binary tree.