Did not understand this one

did not understand this one

In this approach of reversing a linked list by passing a single pointer what we are trying to do is that we are making the previous node of the current node as his next node to reverse the linked list.

  1. We return the pointer of next node to his previous(current) node and then make the previous node as the next node of returned node and then returning the current node.
  2. We first traverse till the last node and making the last node as the head node of reversed linked list and then applying the above procedure in the recursive manner.

so
we traverse to end
make the new head (SmallHead ) as the last node
then on the way of tracking the stack
we change the node linking by
Node* c = head;
c->next->next = c;
c->next = NULL ; // remove the link b.w present and next because it is no longer pointing in forward direction
return smallHead; // which is now the head of the reversed linked lIst

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.