The type of data stored in the node.
The type of the family relationship in the binary tree.
The constructor function initializes a BinaryTreeNode object with a key, value, and count.
The key
parameter is of type K
and represents the unique identifier
of the binary tree node.
Optional
value: VThe value
parameter is an optional parameter of type V
. It represents the value of the binary
tree node. If no value is provided, it will be undefined
.
Optional
count: number = 1The count
parameter is a number that represents the number of times a particular value
occurs in a binary tree node. It has a default value of 1, which means that if no value is provided for the count
parameter when creating a new instance of the BinaryTreeNode
class.
The function returns the value of the protected variable _count.
The count property of the object, which is of type number.
The above function sets the value of the count property.
The value parameter is of type number, which means it can accept any numeric value.
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.