Abstract Linked Lists - v1.2.1
    Preparing search index...

    Function unshiftNode

    • Adds a node to the beginning of a doubly linked list.

      Any pointers node already carries are overwritten, so a node that was linked elsewhere brings none of its former neighbours with it.

      • Time Complexity: O(1)
      • Space Complexity: O(1)

      Type Parameters

      Parameters

      • instance: L

        The list instance.

      • node: NonNullable<L["head"]>

        The node to add.

      Returns void