C Program to Reverse a Linked List using Recursion

Write a c program to reverse a linked list using recursion. Given a singly linked list, we have to write a code to reverse a linked list using recursion. This question is very important in terms of interviews.

In my previous post, I have explained C program to reverse a singly linked list. In this post, We are going to write a code to reverse a linked list using recursion.  If you are not familiar with the concept of recursion then check my previous tutorial on recursion vs iteration.

The time complexity to reverse a linked list using recursion is O(n). 

C Program to Insert a Node at the Beginning of Linked List

Write a C program to insert a node at the beginning of linked list. In this tutorial, we create a linked list and insert a new node at the beginning/head of linked list.

A Linked list is a linear data structure which consists a group of nodes and each node points to next node by means of a pointer. In Linked list, a node consists of two parts, a data and a pointer to next node.