Adds a node to the beginning of a singly linked list.
The node's next pointer is replaced by the current head, so it brings no former successor with it.
next
O(1)
The type of the list.
The list instance.
The node to add.
Adds a node to the beginning of a singly linked list.
The node's
nextpointer is replaced by the current head, so it brings no former successor with it.O(1)O(1)