run time error for one of my test case rest are okay.
Linked list k-append
Do one simple thing. Make a function which pushes the last node of the linked list to its front. Call it k times. And finally print the list.
can you please elaborate!?
Lets say our linked list is - 1 2 3 4 5
Make a function which does the pushes the last node to the front ie., after one function call, the linked list will look like -
5 1 2 3 4
Just call it k times in the int main() and display the final liked list.
i’ll have to traverse every time to the end of the list,
won’t it take much time?
Don’t worry. It will pass all the test cases.
okay ,i’ll try
thank you
can’t get the option to do it
It must be coming up in the “Ask Doubts” section of your course.