Given a linked list having n nodes. Reverse the list using recursive approach.
Please try solving this problem before jumping on the solution
Click to learn
Subscribe for more updates
Preparing for interviews? IDeserve team is here to help.
Create your profile
Create your profile, and here is what you will get:
1: Interview practice platform.
2: Once you are ready to take the interview, IDeserve team will help you get connected to the best job opportunities.
3: Personalized mentorship from IDeserve team once your interview process has started.
Creation of profile shouldn't take more than 2 minutes.
Start with node curr as head. 1. If curr is null, return. 2. If curr's next element is null, this means it is the last node, so make this as head because the last node will be the head of reversed list. Return. 3. Recursively traverse the list. 4. Set curr->next->next to curr. 5. Set curr->next to null
Support us by whitelisting IDeserve in your ad-blocker.