K reverse in linked list

I’m not able to get the whole LL in output instead of 9 items its just printing 7 items .

Hey @anika203a please share your code using ide.codingblocks.com so that I can help you

In line 47 make you node *N =null;
Rest everything is good in your Kreverse linked list function :slight_smile:

Still unable to get the whole list
image

Okay so issue is in your main function, in line 75 make head =Kreverse(head,k) as you are not updating your head


See @anika203a

Yes,it worked.
Thank you so much!!

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.