JAVA || Stack || Easy Solution with explanation
\n![image](https://assets.leetcode.com/users/images/1cef0f2a-8143-45ee-b2c3-58417fdb7aa3_1624714953.3397665.jpeg)\n![image](https://assets.leetcode.com/users/im
```\n![image](https://assets.leetcode.com/users/images/1cef0f2a-8143-45ee-b2c3-58417fdb7aa3_1624714953.3397665.jpeg)\n![image](https://assets.leetcode.com/users/images/d582cb78-f39e-4dae-9d52-94109194f378_1624714953.383273.jpeg)\n\nclass Solution \n{\n    public void reorderList(ListNode head) \n    {\n        int n=0;\n        Stack<ListNode> track=new Stack<>();\n        ListNode temp=head;\n        \n        while(temp != null)\n        {\n            track.push(temp);//pushing the node into the stack \n            temp=temp.next;\n            n+=1;//counting the length \n        }\n        \n        temp=head;\n        \n        for (int i=0; i<n/2;i++)//traversing to only the half length \n        {\n            ListNode str=temp.next;//storing the next node \n            \n            temp.next=track.peek();//current node pointing to the next node \n            track.pop().next=str;//maintaining the link \n            \n            temp=temp.next.next;//as the pair consist of 2, we are covering 2 node at a time \n        }\n        \n        temp.next = null;//to remove the cycle or the cyclic dependency of the elements\n    }\n}//Please do vote me, It helps a lot\n```
['Stack', 'Java']