How do you reverse a linked list
Anonymous
There are several ways you can reverse a linked list. One way would be to traverse through the list, each time removing the node you visit, and push the value of the node onto a stack. Once the list is empty, you pop the values one by one off the stack and append it onto the linked list until the stack is empty. The result is the same linked list only in reverse order. You could also append the values onto a separate list if you do so desire. If I missed anything, let me know. Happy problem solving!
Check out your Company Bowl for anonymous work chats.