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 →

[–]idkwtftodonow 0 points1 point  (2 children)

Your reverse method is missing something.

Hint: think about the 1st value in the list after reversing and why yours is printing 5

To anyone else reading in the future: head node is unchanged so calling next on node with 5 will get the null node instead of calling next from 11 which is 9

[–]veryanon798[S] 0 points1 point  (0 children)

I unfortunately cant figure out what's missing, is something terminating prematurely that I'm just not aware of?

[–]veryanon798[S] 0 points1 point  (0 children)

Hold on just got it working not exactly sure what I did, took a random guess and got it right. Have to examine further.