# Category Archives: Recursion

Given an array, arr[], and an integer K, the task is to find the total number of ways in which we can divide the array… Read More
Modifying Exceptions During Runtime: Suppose there is a Registration Form. If you got exceptional data in the form like in the place of Name you… Read More
In the Lisp programming language, recursion is a commonly used technique for solving problems. Lisp is a functional programming language, which means it is well-suited… Read More
Given an array, write functions to find the minimum and maximum elements in it.  Example: C++ // C++ program to find minimum (or maximum) element… Read More
What is Recursion? Recursion is a programming approach where a function repeats an action by calling itself, either directly or indirectly. This enables the function… Read More
What is Recursion? In simple words, recursion is when a function is calling itself directly or indirectly.  It is used to break down the problem… Read More
Given an array item[] representing type, weight, and profit of N items, the task is to maximize the profit by picking different types of elements… Read More
What is tail recursion? Tail recursion is defined as a recursive function in which the recursive call is the last statement that is executed by… Read More
What is Recursion? The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called a recursive… Read More
Given an array arr[] of size N, the task is to find the maximum number of subsets the array can be split such that the… Read More
Given two integers N and K (K<N), the task is to find the smallest number greater than K by removing digits from N. Note: You… Read More
Write a program to reverse a stack using recursion, without using any loop. Example:  Input: elements present in stack from top to bottom 1 2… Read More
Given an integer matrix mat[][] of size M x N and an integer K, the task is to return the number of paths from top-left… Read More
Given two numbers N and K, and a pair A and B, the task is to multiply N by A or B as many times… Read More
Given a tree with N nodes, an array A[] of size N denoting the value of each node and array edges [][] of size (N-1),… Read More