HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by nolepointer | Hacker News Reader
Parent
Full thread
nolepointer
·
By linked list, do you mean a doubly-linked list?
View on HN
SAI_Peregrinus
·
Wouldn't that make it (even more) trivial, since you can just traverse from the tail backwards? Assuming it has a tail pointer, of course.
nolepointer
·
Yeah, I suppose so. I only asked because reversing a singly-linked list just seems like a PitA.
duskwuff
·
Reversing a singly-linked list is actually
easier
: you take each element off the front of the old list and put it onto the front of the new list.
Reply on news.ycombinator.com