Recall & Review
beginner
What is the main idea behind reversing a singly linked list iteratively?
We change the direction of each node's pointer one by one, so the list points backward instead of forward.
Click to reveal answer
beginner
In the iterative reversal of a singly linked list, which pointers do we typically use?
We use three pointers: previous (starts as NULL), current (starts at head), and next (to store current's next node).
Click to reveal answer
beginner
Why do we need to store the next node before changing the current node's pointer?
Because once we change the current node's pointer to previous, we lose the original next node. Storing it first lets us continue traversing the list.
Click to reveal answer
beginner
What is the time complexity of reversing a singly linked list iteratively?
It is O(n), where n is the number of nodes, because we visit each node exactly once.
Click to reveal answer
beginner
Show the final state of the list after reversing: 1 -> 2 -> 3 -> NULL
After reversal, the list becomes: 3 -> 2 -> 1 -> NULL
Click to reveal answer
Which pointer should initially be set to NULL when reversing a singly linked list iteratively?
✗ Incorrect
The previous pointer starts as NULL because the new tail node will point to NULL after reversal.
What do we do after changing the current node's next pointer to previous?
✗ Incorrect
We move previous to current and current to next to continue reversing the list step by step.
What happens if we forget to store the next node before changing pointers?
✗ Incorrect
Without storing next, we lose the link to the rest of the list and cannot continue traversal.
What is the new head of the list after iterative reversal?
✗ Incorrect
After reversal, the original tail becomes the new head.
What is the space complexity of iterative reversal of a singly linked list?
✗ Incorrect
We only use a few pointers, so space complexity is constant O(1).
Explain step-by-step how to reverse a singly linked list using iteration.
Think about how pointers move and change direction one by one.
You got /8 concepts.
Describe why reversing a singly linked list iteratively is efficient in terms of time and space.
Focus on how many times nodes are visited and how much memory is used.
You got /4 concepts.
