My C++ solution by using pointer's pointer to do insertion.
Short and easy way to manipulate the list.\n \n\n    class Solution {\n    public:\n        ListNode insertionSortList(ListNode head) {\n            ListNode no
Short and easy way to manipulate the list.\n \n\n    class Solution {\n    public:\n        ListNode *insertionSortList(ListNode *head) {\n            ListNode **node = &head;\n            while ((*node)) {\n                bool flag = false;\n                for (ListNode **cmp=&head; *cmp!=*node; cmp=&(*cmp)->next) {\n                    if ((*node)->val <= (*cmp)->val) {\n                        //Do insertion\n                        ListNode *tmp = *node;\n                        *node = (*node)->next;\n                        tmp->next = *cmp;\n                        *cmp = tmp;\n                        flag = true;\n                        break;\n                    }\n                }\n                //Node has been moved to the next already.\n                if (flag) continue;\n                node = &(*node)->next;\n            }\n            return head;\n        }\n    };
[]