i am getting tle , pls help
💡 Sort linked list using insertion sort
problem is in the else part line no 49 try to find it
take a case 5 4 3 2 1
ur code is running infinitely for all the cases of desecnding seq and other also
if not finded reply i will correct the code
sir could you pls tell me how to correct my mistake
ok i wi gave u a hint
When in array we do insertion sort we first start from tge 2nd element and traverse back and check for the greater element
now in link list u cannot go back iteratively So u have to use recursion .
Try think using recursion
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.