Recall & Review
beginner
What does the 'push' operation do in a linked list?
It adds a new node at the beginning (head) of the linked list, making it the new first element.
Click to reveal answer
beginner
In a singly linked list, what pointer does the new node's 'next' field point to during a push?
It points to the current head node before the new node becomes the head.
Click to reveal answer
intermediate
Why is push operation efficient in a linked list?
Because it only changes a few pointers and does not require shifting elements, so it runs in constant time O(1).
Click to reveal answer
beginner
What happens to the head pointer after a push operation?
The head pointer is updated to point to the newly added node.
Click to reveal answer
beginner
Show the sequence of nodes after pushing 3 nodes with values 10, 20, 30 in that order on an empty linked list.
After pushing 10: 10 -> null<br>After pushing 20: 20 -> 10 -> null<br>After pushing 30: 30 -> 20 -> 10 -> null
Click to reveal answer
What is the time complexity of the push operation in a singly linked list?
✗ Incorrect
Push adds a node at the head and only changes pointers, so it runs in constant time O(1).
When pushing a new node, what should the new node's next pointer be set to?
✗ Incorrect
The new node's next pointer should point to the current head node before updating the head.
After pushing a node, which pointer changes in the linked list?
✗ Incorrect
Only the head pointer changes to point to the new node after push.
If the linked list is empty, what does the new node's next pointer point to after push?
✗ Incorrect
When the list is empty, the new node's next pointer points to null.
Which of these is NOT true about push operation in linked list?
✗ Incorrect
Push does not require shifting nodes; it only changes pointers.
Explain step-by-step how to push a new node with value X onto a singly linked list.
Think about what happens to the head pointer and the new node's next pointer.
You got /3 concepts.
Describe how the linked list changes visually after pushing nodes with values 5, then 15, then 25.
Draw the list after each push to see the new head.
You got /3 concepts.