Easy C++ Solution 5 lines
I hope this solution helps you\n\nMostly in tech interviews interviewer may ask us not to use in-built functions. At that time this code might not be handy\n**\
# **I hope this solution helps you*\n\n***Mostly in tech interviews interviewer may ask us not to use in-built functions. At that time this code might not be handy***\n```**\n\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode() : val(0), next(nullptr) {}\n *     ListNode(int x) : val(x), next(nullptr) {}\n *     ListNode(int x, ListNode *next) : val(x), next(next) {}\n * };\n */\nclass Solution {\npublic:\n    ListNode* insertionSortList(ListNode* head) {\n        ListNode* temp = head;  //create a temp list\n        while(temp->next != NULL){\n            ListNode* a = temp->next;  //assign next value of the temp list\n           while(a){\n            if(temp->val > a->val){  //compare the values\n                swap(a->val, temp->val);   //swap if condition fails\n            }\n            a = a->next;\n        }\n        temp = temp->next;\n       } \n        return head;\n    }\n};\n```\n\n**Upvote if useful. Happy Coding :)**
['Linked List', 'C']