Class BinaryTreeNode<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 BinaryTreeNode<K, V, NODE> = BinaryTreeNode<K, V, BinaryTreeNodeNested<K, V>>

    The type of the family relationship in the binary tree.

Hierarchy

Constructors

Accessors

Constructors

  • The constructor function initializes an object with a key and an optional value.

    Type Parameters

    Parameters

    • key: K

      The "key" parameter is of type K, which represents the type of the key for the constructor. It is used to set the key property of the object being created.

    • Optional value: V

      The "value" parameter is an optional parameter of type V. It represents the value associated with the key in the constructor.

    Returns BinaryTreeNode<K, V, NODE>

Accessors

  • get familyPosition(): FamilyPosition
  • Get the position of the node within its family.

    Returns FamilyPosition

    • The family position of the node.
  • get left(): undefined | null | NODE
  • The function returns the value of the _left property, which can be of type NODE, null, or undefined.

    Returns undefined | null | NODE

    The left node of the current node is being returned. It can be either a NODE object, null, or undefined.

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

    Parameters

    • v: undefined | null | NODE

      The parameter v can be of type NODE, null, or undefined.

    Returns void

  • get right(): undefined | null | NODE
  • The function returns the right node of a binary tree or null if it doesn't exist.

    Returns undefined | null | NODE

    The method is returning the value of the _right property, which can be a NODE object, null, or undefined.

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

    Parameters

    • v: undefined | null | NODE

      The parameter v can be of type NODE, null, or undefined.

    Returns void

Generated using TypeDoc