my code is not working fine can u plz suggest
here is the link
Ll k append not working properly
@ayush1213
Your approach seems wrong. There is no need to reverse any part of the linked list and I donβt really understand why you are doing it. Also recursion is not required for this problem. This is a pretty straightforward problem.
Say there are n elements in your list. Just go to (n-k) th element . Store its next in a temp variable. Make the next of current element as NULL as this would be the new end of our linked list. Now join the next pointer of the last element of the linked list starting with temp to our previous head pointer. This should do it.
tq very much sir helped a lot