YOU WILL NEVER FORGET THIS SOLUTION🤯 || JAVA 100% FASTER🔥🔥|| STEP BYSTEP EXPLAINED😊
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->O(N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(1)\n\n![Screenshot_20230205_171246.png](https://assets.leetcode.com/users/images/6c995458-e63a-420f-b3fe-135f2dff6519_1679117775.3755183.png)\n\n# Code\n```\n/**\n * Definition for singly-linked list.\n * public class ListNode {\n *     int val;\n *     ListNode next;\n *     ListNode() {}\n *     ListNode(int val) { this.val = val; }\n *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }\n * }\n */\nclass Solution {\n    public void reorderList(ListNode head) {\n        // Check if the given list is empty or has only one element\n        if (head == null || head.next == null) {\n            return;\n        }\n        \n        // Find the middle node of the list\n        ListNode slow = head;\n        ListNode fast = head;\n        while (fast.next != null && fast.next.next != null) {\n            slow = slow.next;\n            fast = fast.next.next;\n        }\n        \n        // Reverse the second half of the list\n        ListNode prev = null;\n        ListNode curr = slow.next;\n        slow.next = null;\n        while (curr != null) {\n            ListNode next = curr.next;\n            curr.next = prev;\n            prev = curr;\n            curr = next;\n        }\n        \n        // Merge the two halves of the list\n        ListNode p1 = head;\n        ListNode p2 = prev;\n        while (p2 != null) {\n            ListNode next1 = p1.next;\n            ListNode next2 = p2.next;\n            p1.next = p2;\n            p2.next = next1;\n            p1 = next1;\n            p2 = next2;\n        }\n    }\n}\n```
['Linked List', 'Java']