how c points to 2 ?
head is pointing at 1 right , then c should point to 2 not 1 .
can u explain ?
how c points to 2 ?
head is pointing at 1 right , then c should point to 2 not 1 .
can u explain ?
Note that the statements are after the recursive call.So they will execute only after the base of recursion is achieved.When head comes to the last node of the linked list(according to recursive call), the base case is achieved and head is returned(ie. 3). So now the smallhead will be 3. And the current node c will be 2…
Please watch the video again and try to trace the recursion for more clarity.
the current node c will be 2…
how ?
that the point why head is not pointing to 1 ?
Just try to trace the recursion.
Refer this video
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.