getting error in output
Linked list ll k reverse
@sam15jain
Since you have already marked your other doubt as Resolved , I won’t be able to follow up on it. Let us discuss this doubt on this thread rather than on the other one.
@sam15jain
Several of your pointer variables are likely to reach NULL at different instances in your code for different testcases. Mostly ‘end’ in kReverse and n in reverse function. When they become NULL , your code still tries to use them to move to their next as you have not employed proper checks for them. Since an invalid location is being tried to access , your code gives a runtime error.
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.