recursion - How this code prints in reverse order in linked list -
what following function given linked list first node head?
void fun1(struct node* head) { if(head == null) { return; } fun1(head->next); printf("%d ", head->data); }
it if had pushed list elements stack , popped each off , printed until stack empty. although using call stack rather data structure.
Comments
Post a Comment