Class RedBlackTreeNode<K, V>

Type Parameters

  • K = any
  • V = any

Constructors

  • Create a Red-Black Tree and optionally bulk-insert items.

    Type Parameters

    • K = any
    • V = any

    Parameters

    • key: K

      See parameter type for details.

    • Optionalvalue: V

      See parameter type for details.

    • color: RBTNColor = 'BLACK'

      See parameter type for details.

    Returns RedBlackTreeNode<K, V>

    New RedBlackTree instance.

    Time O(n log n), Space O(n)

Accessors

  • get familyPosition(): FamilyPosition
  • Gets the position of the node relative to its parent.

    Returns FamilyPosition

    The family position (e.g., 'ROOT', 'LEFT', 'RIGHT').

    Time O(1), Space O(1)