Recall & Review
beginner
What is the base case in the recursive reversal of a singly linked list?
The base case is when the current node is NULL or the next node is NULL, meaning we have reached the end of the list or the list is empty.
Click to reveal answer
intermediate
In recursive reversal, what happens after the recursive call returns?
After the recursive call returns, the next node's next pointer is set to the current node, reversing the link between them.
Click to reveal answer
intermediate
Why do we set the current node's next pointer to NULL in recursive reversal?
We set the current node's next pointer to NULL to mark the new end of the reversed list and avoid cycles.
Click to reveal answer
beginner
Show the recursive function signature to reverse a singly linked list in C.
struct Node* reverseRecursive(struct Node* head);
Click to reveal answer
beginner
What is the time complexity of reversing a singly linked list recursively?
The time complexity is O(n), where n is the number of nodes, because each node is visited once.
Click to reveal answer
What does the recursive function return when reversing a singly linked list?
✗ Incorrect
The recursive function returns the new head of the reversed list after all recursive calls complete.
In recursive reversal, which pointer is changed to reverse the link?
✗ Incorrect
The next node's next pointer is set to the current node to reverse the link.
What is the base case condition in recursive reversal?
✗ Incorrect
The base case is when the list is empty (head == NULL) or only one node remains (head->next == NULL).
What happens to the current node's next pointer after reversing the link?
✗ Incorrect
The current node's next pointer is set to NULL to mark the new end of the list.
What is the space complexity of recursive reversal of a singly linked list?
✗ Incorrect
Recursive calls use stack space proportional to the number of nodes, so space complexity is O(n).
Explain step-by-step how recursion reverses a singly linked list.
Think about what happens after the recursive call returns.
You got /5 concepts.
Write the recursive function in C to reverse a singly linked list and explain each line.
Focus on how pointers are changed after recursion.
You got /5 concepts.
