插入排序
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* insertionSortList(ListNode* head) {
if(!head||!head->next) return head;
ListNode * dummy = new ListNode(-1);
ListNode * cur = head, *pre = dummy;
while(cur!=NULL){
while(pre->next!=NULL&&pre->next->val < cur->val){
pre = pre->next;
}
ListNode * tmp = cur->next