# Category Archives: Recursion

Given a directed binary tree of N nodes whose edges are directed from the parent to the child, the task is to count the numberâ€¦ Read More
Given two integers L and R, the task is to find the count of numbers in the range [L, R] which have only 2 orâ€¦ Read More
Given an n-ary Tree having N nodes numbered from 1 to N, the task is to print a list of nodes containing 0, 1, 2,â€¦ Read More
Given a binary tree, the task is to: Print all the leaf nodes and then delete them all.  Repeat this process till the tree becomesâ€¦ Read More
Given a Binary Tree where each node has a value of either 0 or 1, the task is to convert the given Binary tree toâ€¦ Read More
Given an array A[] of size N and a digit K. Find the number of sub-sequences of the array where the last digit of theâ€¦ Read More
Given a matrix mat[][] of size N * M and an integer K, the task is to find a path from the top-left cell (0,â€¦ Read More
Given an array arr[] that contains N integers, the task is to find the largest subset having sum at least 0. Examples: Input: arr[] =â€¦ Read More
Given an array arr[] and integer K, the task is to count the number of subsequences of the array such that after adding all theâ€¦ Read More
Given an array arr[] containing N integers and an integer K, the task is to minimize the subset-sum difference after removing K elements from theâ€¦ Read More
Given three strings, ‘X‘, ‘Y‘ and ‘Z‘, the task is to count the number of subsequences of ‘X‘ which is lexicographically greater than or equalâ€¦ Read More
Given two integers N and H, the task is to find the count of distinct Binary Search Trees consisting of N nodes where the maximumâ€¦ Read More
Given two strings A and B of size N and M respectively, where B is a sub-sequence of A and an array arr[] of sizeâ€¦ Read More
Given a matrix of size N * M and Q queries, the task is to find how many different regions will be there, after performingâ€¦ Read More
Given two integer arrays A[] and B[] of different length N and M respectively, the task is to choose any subsequence of same length fromâ€¦ Read More