public ListNode sortList(ListNode head) {
            if (head == null || head.next == null) {
                return head;
            }

            ListNode fast = head;
            ListNode slow = head;

            while (fast.next != null && fast.next.next != null) {
                slow = slow.next;
                fast = fast.next.next;
            }

            fast = slow;
            slow = slow.next;
            fast.next = null;

            return merge(sortList(head), sortList(slow));
        }