[Beats 100% 🔥] Beginner Friendly Easy to Understand Explanation 🚀 
IntuitionTo reorder the linked list, we need to place the last node after the first, the second-last after the second, and so on. We can achieve this by breakin
# Intuition
To reorder the linked list, we need to place the last node after the first, the second-last after the second, and so on. We can achieve this by breaking the list into two halves, reversing the second half, and merging them alternately.

# Approach
1. **Find the Middle:**  
   - Use slow and fast pointers to locate the middle of the list.  
   - Split the list into two halves by setting `prev.next = null`.

2. **Reverse the Second Half:**  
   - Reverse the second half of the list in-place.

3. **Merge Both Halves Alternately:**  
   - Merge nodes from both halves one by one to form the reordered list.

# Complexity
- **Time complexity:** $$O(N)$$ – Finding the middle, reversing, and merging each take linear time.  
- **Space complexity:** $$O(1)$$ – No extra space used; modifications are done in-place.


# Code
```java []
class Solution {
    public void reorderList(ListNode head) {
        if (head == null || head.next == null || head.next.next == null) return;

        // Step 1: Find the middle of the list
        ListNode slow = head, fast = head, prev = null;
        while (fast != null && fast.next != null) {
            prev = slow;
            slow = slow.next;
            fast = fast.next.next;
        }
        prev.next = null; // Split the list into two halves

        // Step 2: Reverse the second half
        ListNode secondHalf = reverseList(slow);

        // Step 3: Merge both halves alternately
        mergeLists(head, secondHalf);
    }

    private ListNode reverseList(ListNode head) {
        ListNode prev = null, curr = head, next;
        while (curr != null) {
            next = curr.next;
            curr.next = prev;
            prev = curr;
            curr = next;
        }
        return prev; // New head of the reversed list
    }

    private void mergeLists(ListNode first, ListNode second) {
        while (first != null && second != null) {
            ListNode temp1 = first.next;
            ListNode temp2 = second.next;

            first.next = second;
            if (temp1 == null) break;
            second.next = temp1;

            first = temp1;
            second = temp2;
        }
    }
}

```

**Please Upvote⬆️**

![Screenshot 2025-02-15 121221.png](https://assets.leetcode.com/users/images/f78e4f7f-4139-4b91-b3a6-f215c49c1082_1739607259.811192.png)

['Linked List', 'Two Pointers', 'Sorting', 'Java']