Sort a linked list using insertion sort.
用插入排序来排链表
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) {
* val = x;
* next = null;
* }
* }
*/
public class Solution {
public ListNode insertionSortList(ListNode head) {
if(head==null||head.next==null)
return head;
ListNode p=head.next;
while(p!=null){
ListNode q=head;
while(q.val<p.val)
q=q.next;
if(p!=q){
int temp=q.val;
q.val=p.val;
while
}
}
}
}