Skip to content

Category Archives: Recursion

Given a Binary Tree consisting of N nodes, the task to find the maximum average of values of nodes of any subtree. Examples:  Input:   â€¦ Read More
Given a Binary Tree, the task is to remove the leaf nodes of the Binary Tree during each operation and print the count. Examples: Input:  â€¦ Read More
Given an integer N, the task is to count the number of N-length strings consisting of lowercase vowels that can be generated based the following… Read More
Given an N-Ary tree, the task is to print all root to leaf paths of the given N-ary Tree. Examples: Input:         â€¦ Read More
Given an array arr[] consisting of N integers and a positive integer K, the task is to find all permutations of the array arr[] such… Read More
Given two integers N and M, the task is to find their LCM using recursion. Examples: Input: N = 2, M = 4Output: 4Explanation: LCM… Read More
Given an array arr[] of size N and an integer K, the task is to find the minimum cost required to reduce given array to… Read More
Given a numeric string S of length M and an integer N, the task is to find all distinct combinations of S (repetitions allowed) that… Read More
Given an N-ary Tree consisting of N nodes valued from 1 to N, an array arr[] consisting of N positive integers, where arr[i] is the… Read More
Given an undirected graph with N vertices and N edges that contain only one cycle, and an array arr[] of size N, where arr[i] denotes… Read More
Given an array arr[] consisting of N integers, the task is to find the minimum cost to remove all elements from the array such that… Read More
Given a string str of length N, the task is to print all possible non-empty subsequences of the given string such that the subsequences either… Read More
Given an integer N, the task is to reduce the value of N to 0 by performing the following operations minimum number of times: Flip… Read More
Given a string str of length N, the task is to print all possible distinct subsequences of the string str which consists of non-repeating characters… Read More

Start Your Coding Journey Now!