Question: I was searching on how can I print a reverse of linked list and I found this piece of code 

```
/* Function to reverse the linked list */
void printReverse(struct node* head)
{
    // Base case  
    if (head == NULL)
       return;

    // print the list after head node
    printReverse(head->next);

    // After everything else is printed, print head
    printf("%d  ", head->data);
}

```

The problem is that I do not understand the part where it reaches the last pointer which points to NULL and how it comes back one by one and prints the linked list in reverse order.

Is the return statement what makes it go step by step back? Or something else? Please help because I do not understand.

Answer: 
This is a recursive function. Recursive functions work by pushing variables onto the execution stack. The execution order pops off the stack in reverse order from the order it was pushed on the stack. This means that the last execution prints first, then the one previous to that, and so forth until all executions of printReverse print their values.
The thing that makes it go in reverse is *to have the `printf()` call **after** the recursive call to itself*.

You can try interchanging the two calls as in

```
void printNormal(struct node* head)
{
    // Base case  
    if (head == NULL)
       return;

    // Before all, we print this node info.
    printf("%d  ", head->data);

    // print the rest of the list after this node
    printReverse(head->next);

}

```

And you'll get the forward printing of the list.

The mission of the so commented *Base case* is to avoid infinite recursion. The end of the list is special, we can do the check on entering the `printReverse()` function, so we can deal with the special case of an empty list, or we have to do it at each call (then we should put a check before calling the function inside it, and in the code that calls the recursive function (better to put it at the beginning).