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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -