public Node sort(Node head){
        Node result = null;
        Node start = head;
        while(head != null && head.next != null){
            if(head.data < head.next.data){
                head = head.next;
            }else{
                Node temp = head.next;
                head.next = null;
                result = mergeSort(result,start);
                head = temp;
                start = temp;
            }
        }
        result = mergeSort(result,start);
        return result;
    }
Given a linklist which has individual sorted componenets sort the entire linst
e.g 1-3-6-8-4-5-10-7-9
Here 1,2,6,8 are sorted, 4,5,10 are sorted and 7,9 are sorted
Test case
null node
1 node
2 sorted nodes
2 reverse sorted nodes
3 reverse sorted nodes
4 nodes 2 each sorted among themselves
src/com/interview/linklist/SortNearlySortedList.java