← Linked List Quiz: all 8 questions
Linked List Quiz · Question 3 of 8
The list is 1 → 2 → 3 → 4 → 5. Which node does the fast & slow pointer method return as the middle?
The list is 1 → 2 → 3 → 4 → 5. Which node does the fast & slow pointer method return as the middle?
Answer & explanation
Correct answer: 3
slow moves 1 step and fast moves 2; when fast reaches the end, slow is at 3.
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 →