Maybe the best JAVA solution with code comments
public class Solution {\n    \n        public ListNode insertionSortList(ListNode head) {\n            if(head == null || head.next == null){\n                r
    public class Solution {\n    \n        public ListNode insertionSortList(ListNode head) {\n            if(head == null || head.next == null){\n                return head;\n            }\n            //record node before insertNode\n            ListNode preNode = head;\n            //rocord node need to be inserted\n            ListNode insertNode = head.next;\n            \n            while(insertNode != null){\n                //store next insert node\n                ListNode nextInsert = insertNode.next;\n                //insert before head\n                if(insertNode.val <= head.val){\n                    preNode.next = insertNode.next;\n                    insertNode.next = head;\n                    head = insertNode;\n                }\n                else if(insertNode.val >= preNode.val){    //insert after tail\n                    preNode = preNode.next;\n                }\n                else{                                      //insert between head and tail\n                    ListNode compareNode = head;\n                    //start from the node after head, find insert position\n                    while(compareNode.next.val < insertNode.val)   compareNode = compareNode.next;\n                    //insert\n                    preNode.next = insertNode.next;\n                    insertNode.next = compareNode.next;\n                    compareNode.next = insertNode;\n                }\n                //get next insert node\n                insertNode = nextInsert;\n            }\n            return head;\n        }\n    }\n\nHope it will helpful. The thinking is  very straightforward:\n\n 1. Insert before head.\n 2. Insert after tail.(no need change the list).\n 3. Insert between head and tail.
['Java']