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).
Write a c program to find missing number in array. Given an array of numbers from 1 to n. The array is sorted. One number is missing from an array. You have to write a c code to find the missing number from an array. Also ,there is no duplicates in an array. This type of questions is generally asked in technical interviews.
How to swap two numbers using call by reference in C , C++. In the interviews interviewer generally asked the difference between call by reference and call by value. In this post let’s understand what is call by reference and how to swap two numbers using call by reference method.
MCQ on Recursion
Recursion is the most important concept in computer science. In this tutorial, You’ll find practice questions related to recursion.
Recursion video tutorials
In my previous posts, i have written about binary search implementation using recursion and difference between recursion and iteration.
These MCQ helps you to understand the concept of Recursion.
1) Which Data Structure is used to perform Recursion?
c) Linked List
Write a program to implement binary search using recursion in c. Given a sorted array, we have to search a element in an array using binary search algorithm.
We have a sorted array and we have to search an element from an array using recursive binary search program in c.
What is binary search?
Binary Search is a searching algorithm that search an element in a sorted array in O(logN) time complexity.
In my previous tutorial, I have discussed Binary search program in c using iterative approach. In this post, I am going to explain how to implement a binary search program in c using recursion.
Write a code to implement binary search program in c. Given a sorted array, we have to write a code to search an element in an array using binary search.
A Binary Search is used to search an element in a sorted array. In binary search, we first calculate the mid position of an array. Then, After that we compare element to be search to the middle element an array. If a value matches with the middle element then the index is returned otherwise the algorithm repeats if the value is less than or greater than the middle element.
A Binary search algorithm is efficient than the linear search algorithm. The time complexity of binary search is O(log(n)).
Write a program to print middle element of a linked list. It is also the most asked question in interviews. I assume you have a basic understanding of linked list and it’s concept.
Write a stack program in C using an array. Implement a stack data structure using an Array. In this tutorial, You are going to learn about stack data structure and it’s implementation in C using an array.
C Program to Implement a Stack using Linked List
What is a Stack Data Structure?
A Stack is a Data Structure, in which insertion and deletion operations are allowed only at one end. It worked on LIFO (Last In First Out) Principle. In LIFO, an element which inserted last must be the first element to be removed.
Write a C program to reverse a linked list. Given a singly linked list, we have to write a code to reverse a linked list. In this tutorial, we are going to use iterative approach to solve this problem.
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.