easy to understand
\n/**\n * Definition for singly-linked list.\n * public class ListNode {\n *     int val;\n *     ListNode next;\n *     ListNode() {}\n *     ListNode(int val)
```\n/**\n * Definition for singly-linked list.\n * public class ListNode {\n *     int val;\n *     ListNode next;\n *     ListNode() {}\n *     ListNode(int val) { this.val = val; }\n *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }\n * }\n */\nclass Solution {\n    public ListNode insertionSortList(ListNode head) {\n        if(head == null) return head;\n        ListNode current = head.next;\n        ListNode pre = head;\n        while(current !=null){\n            if(current.val>=pre.val){\n                current = current.next;\n                pre = pre.next;\n            }\n            else{\n                pre.next = current.next;\n                if(current.val<=head.val){ \n                    current.next = head;\n                    head = current;\n                }\n                else{\n                    ListNode search = head;\n                    while(search.next != null && search.next.val<current.val){\n                        search = search.next;\n                    }\n                    ListNode tmp = search.next;\n                    search.next = current;\n                    current.next = tmp;\n                }\n                current = pre.next;\n            }\n        }\n        return head;\n    }\n}\n```
['Java']