using Bubble sort in C
Intuition\njust use the bubble sort.the only difference is u need to reset the pointer to point head after the completation of second loop and in second loop u 
# Intuition\njust use the bubble sort.the only difference is u need to reset the pointer to point head after the completation of second loop and in second loop u need to swap two values if one val is greater than another.then update temp pointer to its next\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\nO(n^2)\n\n- Space complexity:\nO(1)\n# Code\n```\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     struct ListNode *next;\n * };\n */\n void swap(struct ListNode *p1,struct ListNode *p2)\n {\n     int t=p1->val;\n     p1->val=p2->val;\n     p2->val=t;\n }\n int len(struct ListNode *head)\n {\n     struct ListNode *p=head;\n     int l=0;\n     while(p!=NULL)\n     {\n         l++;\n         p=p->next;\n     }\n     return l;\n }\nstruct ListNode* insertionSortList(struct ListNode* head){\n    struct ListNode *p=head;\n    int i,j;\n    int l=len(head);\n    for(i=0;i<l;i++)\n    {\n        for(j=0;j<l-i-1;j++)\n        {\n            if(p->val>p->next->val)\n            {\n                swap(p,p->next);\n            }\n            p=p->next;\n        }\n        p=head;\n    }\n    return head;\n\n}\n```
['Linked List', 'C', 'Sorting']