Function replace

  • Replaces the subtree rooted at a given node with a new node. The function updates parent pointers accordingly.

    Parameters

    • child: Node

      The node to replace

    • newChild: Node

      The new node to replace the old node with

    Returns Node

    The new child node or null if the child node was a root node

    Throws

    If the child node does not have a parent node set

Generated using TypeDoc