Recall & Review
beginner
What does 'Insert at Beginning' mean in a linked list?
It means adding a new node at the start (head) of the linked list, making it the first element.
Click to reveal answer
beginner
Why is inserting at the beginning of a linked list efficient?
Because it only requires changing the head pointer and the new node's next pointer, which takes constant time O(1).
Click to reveal answer
intermediate
In C, what pointer changes are needed to insert a new node at the beginning of a singly linked list?
Set the new node's next pointer to the current head, then update the head pointer to the new node.
Click to reveal answer
beginner
What happens to the old head node after inserting a new node at the beginning?
The old head becomes the second node in the list, as the new node points to it.
Click to reveal answer
intermediate
Show the basic C code snippet to insert a node at the beginning of a singly linked list.
struct Node* newNode = malloc(sizeof(struct Node));
newNode->data = value;
newNode->next = head;
head = newNode;
Click to reveal answer
What is the time complexity of inserting a node at the beginning of a singly linked list?
✗ Incorrect
Inserting at the beginning only changes a few pointers, so it takes constant time O(1).
Which pointer must be updated to insert a new node at the beginning of a linked list?
✗ Incorrect
The head pointer must point to the new node after insertion.
After inserting a new node at the beginning, what does the new node's next pointer point to?
✗ Incorrect
The new node's next pointer points to the old head node, linking the list.
Which of these is NOT needed when inserting at the beginning of a singly linked list in C?
✗ Incorrect
Traversing the list is not needed because insertion is at the head.
What happens if you forget to update the head pointer after inserting a new node at the beginning?
✗ Incorrect
Without updating head, the new node is not linked as the first node, causing loss of access.
Explain step-by-step how to insert a new node at the beginning of a singly linked list in C.
Think about how pointers change to keep the list connected.
You got /4 concepts.
Describe why inserting at the beginning of a linked list is faster than inserting at the end.
Consider how many nodes you must visit for each insertion.
You got /4 concepts.
