Linklist k append 2 test case fails
Hi Neeraj , I just checked your code . I think there is a lot of redundancy in your code .
The logic behind the question is :-
- you just have to traverse till k-1 node from the head node
- store that position into some other pointer . Make its next as NULL
- Traverse the linked- list from that node till end and attach the head to the end node.
Here is the code you can go through - https://ide.codingblocks.com/s/57436 .
1 Like