A short and clear c++ solution.
c++\nclass Solution {\npublic:\n    ListNode* insertionSortList(ListNode* head) {\n        if(!head) return NULL;\n        ListNode *res = new ListNode(0);\n   
```c++\nclass Solution {\npublic:\n    ListNode* insertionSortList(ListNode* head) {\n        if(!head) return NULL;\n        ListNode *res = new ListNode(0);\n        while(head) {\n            ListNode* p = res->next;\n            ListNode* pre = res;\n            while(p && head->val > p->val) {\n                pre = p;\n                p = p->next;\n            }\n            pre->next = new ListNode(head->val);\n            pre = pre->next;\n            pre->next = p;\n            head = head->next;\n        }\n        return res->next;\n    }\n};\n```
[]