Reverse a singly linked list
What are the time and space complexities of iteratively reversing a singly linked list in place?
Show hints (2)+
- Three pointers suffice (prev, curr, next).
- No auxiliary data structure is allocated.
Answer
Reveal answer →Final answer
$O(n)$ time, $O(1)$ space
Want the full step-by-step worked solution? It's part of Premium — along with a worked solution for every question in the bank.