Print reverse of LL by recursive function
void printReverse(struct node* head)
{
if(head == NULL)
return;
else
printReverse(head->list);
printf("%d",head->data);
}
Time Complexity: O(n)
{
if(head == NULL)
return;
else
printReverse(head->list);
printf("%d",head->data);
}
Time Complexity: O(n)
Comments
Post a Comment