Please help me in the question LL K reverse

Im not able to find any algorithm to this question.

Hey @pssharma1410, for doing this problem you need to have the knowledge of 2 algorithms related to LL.

  1. To find the k’th number from beginning
  2. To reverse a LL

You can start from the beginning of the list and using the first algo, you can determine the k-th element in the list. Now you need to reverse the LL till kth point and next you need to recursively call this task again and have a faith that recursion will solve the further LL.
The problem can be solved using this way

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.