Given a 2D screen arr[][] where each arr[i][j] is an integer representing the color of that pixel, also given the location of a pixel (X,… Read More
Category Archives: Recursion
Prerequisites:- Morris Inorder Traversal, Tree Traversals (Inorder, Preorder and Postorder)Given a Binary Tree, the task is to print the elements in post order using O(N)… Read More
Given a numeric string S representing a large number, the task is to form a Fibonacci Sequence of at least length 3 from the given… Read More
Given an integer N greater than 2, the task is to find an element M such that GCD(N, M) is maximum. Examples: Input: N =… Read More
Given a number N, we need to find the Fibonacci Series up to the N term. The Fibonacci series is a series of elements where,… Read More
Given a binary tree, the task is to find the total count of set bits in the node values of all the root to leaf… Read More
Given a weighted, directed graph G, an array V[] consisting of vertices, the task is to find the Minimum Cost Path passing through all the… Read More
Given an integer N, which denotes the size of the matrix that is N*N. There is a robot placed over the top-left corner (0, 0)… Read More
Given a decimal number as N, the task is to convert N into an equivalent irreducible fraction. An irreducible fraction is a fraction in which… Read More
Given a binary tree and a value K, the task is to check if every node of the binary tree has either the value of… Read More
Given binary string str, the task is to check whether the given string follows the below condition or not: String starts with a ‘1’. Each… Read More
Given an undirected graph defined by the number of vertex V and the edges E[ ], the task is to find Maximal Independent Vertex Set… Read More
Given a string str and two characters X and Y, the task is to write a recursive function to replace all occurrences of character X… Read More
Given a Binary Tree, the task is to find the maximum value of Bitwise AND from any path from the root node to the leaf… Read More
Given a binary tree, the task is to find the absolute difference between the even valued and the odd valued nodes in a binary tree.… Read More