Class BSTNode<K, V, NODE>

Represents a node in a binary tree.

Type Parameters

  • K = any
  • V = any

    The type of data stored in the node.

  • NODE extends BSTNode<K, V, NODE> = BSTNodeNested<K, V>

    The type of the family relationship in the binary tree.

Hierarchy (view full)

Accessors

Accessors

  • get left(): OptNode<NODE>
  • The function returns the value of the _left property.

    Returns OptNode<NODE>

    The _left property of the current object is being returned.

  • set left(v): void
  • The function sets the left child of a node and updates the parent reference of the child.

    Parameters

    • v: OptNode<NODE>

      The parameter v is of type OptNode<NODE>. It can either be an instance of the NODE class or undefined.

    Returns void

  • get right(): OptNode<NODE>
  • The function returns the right node of a binary tree or undefined if there is no right node.

    Returns OptNode<NODE>

    The method is returning the value of the _right property, which is of type NODE or undefined.

  • set right(v): void
  • The function sets the right child of a node and updates the parent reference of the child.

    Parameters

    • v: OptNode<NODE>

      The parameter v is of type OptNode<NODE>. It can either be a NODE object or undefined.

    Returns void