Sort linked list using insertion sort


my code is ending to a undefind output . please check my code

Hello @sk3657860

Your code produces wrong output for the test case
2
2 1
Dry run your code on the above test case to see what the problem is.

Here is the code
I have added comments so that you can understand it.