What should the function return after the loop?

Practice this question from Reverse Linked List - Pointer reversal Pattern Practice Quiz, with options and an explanation.

Question

What should the function return after the loop?

Option A — Correct answer

prev

Option B

curr

Option C

nextNode

Option D

old head always

Explanation

Return prev, which points to the new head.

Reverse Linked List - Pointer reversal Pattern Practice Quiz

All questions · Previous question

Open on QuizMaker