Easy To Understand code Of " insertion-sort-list"
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\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              ListNode d = new ListNode(0, head);\n        \n        ListNode prev = head;\n        ListNode curr = head.next;\n        \n        while (curr != null) {\n            if (curr.val >= prev.val) {\n                prev = curr;\n                curr = curr.next;\n                continue;\n            }\n            \n            ListNode tmp = d;\n            while (curr.val > tmp.next.val) {\n                tmp = tmp.next;\n            }\n            \n            prev.next = curr.next;\n            curr.next = tmp.next;\n            tmp.next = curr;\n            curr = prev.next;\n        }\n        return d.next;\n    }\n}\n```
['Linked List', 'Math', 'Sorting', 'Java']