Hello sir/ma’am,
i was writing code for k-reverse LL and my code shows run time error. I am unable to get why is it showing so. Could you please help me with this.
sharing my code::
Linked List Run time error
hi
your reverse function is giving tle
try to use recursion
Sir, I’ll try recursive approach also but please tell what changes do i need to make in my present code to remove TLE. At first , I could not think of recursive approach so did it iteratively. So please tell the error in my existing code.
the tle is commig due to line 54
just dryrun this example
u will find it
5
2
1 2 3 4 5 6
Okay, Got it. Thanks!!