# Category Archives: Recursion

Given an array arr[] of size N and a given difference diff, the task is to count the number of partitions that we can perform… Read More
Given a positive integer N, the task is to find the number of distinct ways to express N as a sum of positive palindromic integers… Read More
Given an array A[] of positive integers, print all the unique non-empty subsets of the array  Note: The set can not contain duplicate elements, so… Read More
Given N tanks connected like a tree, the connections between them in an array Edge[][], and the capacity of each tank in the array cap[],… Read More
What is a Proper Tail Call? Proper tail calls (PTC) is a programming language feature that enables memory-efficient recursive algorithms. Tail call optimization is where… Read More
Given a number N and a mapping of letters to each integer from 1 to 8, which are: {1: ‘abc’, 2: ‘def’, 3: ‘ghi’, 4: ‘jkl’,… Read More
Given a directed graph with N nodes and M edges in array V[], the task is to find the number of nodes that are accessible… Read More
Given an undirected tree with N nodes numbered from 1 to N and an array A[] where A[i] denotes the value assigned to (i+1)th node.… Read More
Given a string S of length N, the task is to find the number of unique subsequences of the string for each length from 0… Read More
Given a Binary tree, the task is to print the outer cone layer i.e. combination of layers formed by moving only through the left child… Read More
Given a tree with N vertices and N-1 edges represented by a 2D array edges[], the task is to find the minimum value among the… Read More
Given a binary tree, a target node and a positive integer K on it,  the task is to find the sum of all nodes within… Read More
Given a Binary search tree having N nodes, the task is to find all the paths starting at the root and ending at any leaf… Read More
Given an N-ary Tree. The task is to print the level order traversal of the tree where each level will be in a new line.… Read More
Given a connected acyclic graph with N nodes numbered from 1 to N and N-1 edges, find out the pair of nodes that are at… Read More