struct Node* reverseList(struct Node *head)
{
if(!head or head->next==NULL)
{
return head;
}
Node* chotahead=reverseList(head->next);
head->next->next=head;
head->next=NULL;
return chotahead;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter