Hi I am encountering Runtime Error in this code
https://ide.codingblocks.com/s/157367 please let me know what is wrong.
LL- K Reverse: I am encountering problem in this problem of reversal of K elements in a Linked List
In your code the variable “r” points to node 3 and the next of node 3 is 4
Now when you reverse the link from node 2 to 3 TO node 3 to 2, Node 3 no more points node 4 and your while loop never ends because it never finds node 2 again.