insertion Sort List - 100%
class Solution {\n    public ListNode insertionSortList(ListNode head) {\n        ListNode prev = head;\n        ListNode curr = prev.next;\n        \n        i
class Solution {\n    public ListNode insertionSortList(ListNode head) {\n        ListNode prev = head;\n        ListNode curr = prev.next;\n        \n        if(head==null || head.next==null) \n            return head;\n        \n        while(curr != null) {\n            if(curr.val < prev.val) {\n                prev.next = curr.next;\n                if(curr.val <= head.val) {\n                    curr.next = head;\n                    head = curr;\n                } else {\n                    //search starting from the head\n                    ListNode ptr = head;\n                    while(ptr.next!=null && ptr.next.val < curr.val)\n                        ptr = ptr.next;\n                    ListNode temp = ptr.next;\n                    ptr.next = curr;\n                    curr.next = temp;\n                }\n                curr = prev.next;\n            } else {\n                curr = curr.next;\n                prev = prev.next;\n            }\n        }\n       return head; \n    }\n}\n**Please help to UPVOTE if this post is useful for you.\nIf you have any questions, feel free to comment below.\nHAPPY CODING :)\nLOVE CODING :**\n
['Linked List']