标签:har return ext public highlight val sort nod div
class Solution { public ListNode insertionSortList(ListNode head) { ListNode pre=new ListNode(0); ListNode p=head, q; while(p!=null) { q=pre; while(q.next!=null&&q.next.val<p.val) q=q.next; ListNode r=p; p=p.next; r.next=q.next; q.next=r; } return pre.next; } }
标签:har return ext public highlight val sort nod div
原文地址:http://www.cnblogs.com/asuran/p/7679751.html