In this article, we will see how to reverse a linked list in C. We can reverse a linked list using two approaches.

  1. Iterative method
  2. Recursive method




Iterative method

This is the simplest way to reverse a linked list, in which we iterate a loop throughout the linked list and change the direction of the link.
Image show the first Iteration of the loop.

For Example:





OutPut:





Recursive method

A recursionĀ is also another technique to reverse the linked-list. In recursion, we are used stack memory to reverse the linked list.

OutPut: