Class RBTreeNode<T, FAMILY>

Type Parameters

Hierarchy

Implements

  • IRBTreeNode<T, FAMILY>

Constructors

Properties

_color: RBColor = RBColor.RED

Accessors

Methods

  • The clone function returns a new instance of the FAMILY class with the same id, val, and count properties.

    Returns null | FAMILY

    The clone() method is returning a new instance of the FAMILY class with the same id, val, and count values as the current instance.

  • The function creates a new RBTreeNode with the given id, value, and count and returns it as a FAMILY object.

    Parameters

    • id: number

      The id parameter is the identifier for the binary tree node. It is used to uniquely identify each node in the tree.

    • Optional val: null | T

      The "val" parameter represents the value to be stored in the node. It can be of type T (generic type) or null.

    • Optional count: number

      The count parameter represents the number of occurrences of the value in the binary tree node.

    Returns FAMILY

    The method is returning a new instance of the RBTreeNode class, casted as a FAMILY type.

  • The function swaps the location of two nodes in a binary tree.

    Parameters

    • swapNode: FAMILY

      The swapNode parameter is of type FAMILY, which represents a node in a family tree.

    Returns FAMILY

    the swapNode object after swapping its properties with the properties of this object.

Generated using TypeDoc