I have a doubt in this question as it is showing wrong answer.
Linked List K-append
Hi!
The problem here is with the kfromend and kappend functions that you’ve written. Try it by thinking in following direction:
Traverse the list till you traverse k elements, after this Start another traversal in same loop . Now when first pointer reaches the end, it will be k nodes ahead the second pointer. Once this is done you just have to change the pointers
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.