# 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 partition the squares of first N( always a multiple of 8 ) natural numbers into two setsâ€¦ 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