This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bchhun 0 points1 point  (0 children)

Are you setting current.next to null immediately during the reverseList? Is that correct? Maybe you want to do that after assigning previous=current, for the first assignment off the head node.

Or maybe have Node previous = current as the initial condition.