private Node mergeSort(Node head1,Node head2){
        if(head1 == null){
            return head2;
        }
        if(head2 == null){
            return head1;
        }
        if(head1.data <= head2.data){
            head1.next = mergeSort(head1.next,head2);
            return head1;
        }else{
            head2.next = mergeSort(head1,head2.next);
            return head2;
        }
    }
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