← Linked List Quiz: all 8 questions
Linked List Quiz · Question 7 of 8
What are the time and extra space of iterative linked-list reversal?
What are the time and extra space of iterative linked-list reversal?
- A.O(n) time, O(1) space
- B.O(n) time, O(n) space
- C.O(n²) time, O(1) space
- D.O(log n) time, O(1) space
Answer & explanation
Correct answer: O(n) time, O(1) space
One pass, three pointer variables.
Can you get the rest right without peeking?
Take the timed Linked List Quiz quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →