Google Interview Question

Reverse a linked list

Interview Answer

Anonymous

Dec 5, 2018

The best answer i could think of in 6 minutes is to iterate through List removing the elements and adding them to stack and start taking them back from stack when list is empty. Stack is LIFO so the last list element would be the first one we would get.