Reverse a Linked List using Recursion

Write a program to reverse a linked list using recursion. Given a linked list print them in reverse order using recursion. This question is mostly asked in interviews.

In my last post, I have explained how to reverse a linked list using an iterative approach. In this post, We will learn how to reverse a linked list using recursion.  The time complexity for both iterative and recursive approach is O(n).

What is a Linked List

Linked list is a linear collection of data elements, called nodes. Each node is connected to a next node by links ( using a pointer). So linked list is a group of nodes which together represent a sequence. Each node consists of two parts a data and a pointer to next node.

Subscribe Our Tutorials

Get Latest Updates on Facebook

I assume you have basic understand of recursion. If you are not familiar with recursion then check my previous post on recursion concept and difference between recursion and iteration.

Program to Reverse a Linked List using Recursion

Some more questions on linked list –

Insert a node at the head of a linked list

Count number of nodes in a linked list

About WebRewrite

I am technology lover who loves to keep updated with latest technology. My interest field is Web Development.
Tagged , , . Bookmark the permalink.