public ListNode sortList(ListNode head) {
        if(head == null || head.next == null) return head;
        ListNode partition = getMidNode(head);
        ListNode mid = partition.next;
        partition.next = null;

        ListNode first = sortList(head);
        ListNode second = sortList(mid);
        return merge(first, second);
    }