Yelp interview question

How would you reverse a linked list?

Interview Answers

Anonymous

1 Jul 2016

Using a stack takes extra space, we can reverse a linked list without using any extra space and by just O(n);

1

Anonymous

7 May 2016

Use a stack