There can be two solution for reversing linked list
1. Iterative
2. Recursive
Iterative:
Logic for this would be:
Have three nodes i.e previousNode,currentNode and nextNode
When currentNode is starting node, then previousNode will be null
Assign currentNode.next to previousNode to reverse the link.
In each iteration move currentNode and previousNode by 1 node.
Read more at http://www.java2blog.com/2014/07/how-to-reverse-linked-list-in-java.html