Question

To insert a new node at the beginning of a singly linked list, which of the following operations is typically performed?

A Update the `next` pointer of the last node to point to the new node.
B Update the `next` pointer of the new node to point to the current head, then make the new node the head.
C Traverse the entire list to find the insertion point.
D Shift all existing elements to make space for the new node.
E Decrement the size of the list.
Practice Next

Hey! Ask a query