# Category Archives: Recursion

Given two strings S1 and S2 of equal length, the task is to determine if S2 is a scrambled form of S1.Scrambled string: Given string str,… Read More
Given two positive integers N1 and N2, the task is to find the sum of the products of the same placed digits of the two… Read More
Given an N*N binary matrix arr[][], the task is to check if the matrix contains a square of at least size 2 x 2 whose… Read More
Given a matrix board of characters and a string Word, the task is to check if Word exists on the board constructed from a sequence… Read More
Given a numeric string N and an integer K, the task is to split digits of N into subparts such that the number of segments… Read More
Given two non-zero integers M and N, the problem is to compute the result of the Ackermann function based on some particular equations. Ackermann function… Read More
A mother vertex in a Graph G = (V, E) is a vertex v such that a path from v can reach all other vertices… Read More
Given a binary tree having N nodes and weight of N-1 edges. The distance between two nodes is the sum of the weight of edges… Read More
Dynamic Programming is one way which can be used as an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls… Read More
Given an undirected graph of N vertices and M edges, the task is to assign directions to the given M Edges such that the graph… Read More
Given a tree of N nodes, the task is to find the node having maximum depth starting from the root node, taking the root node… Read More
In the number guessing game, the user selects a number within a defined range and then the program guesses the number. If the number guessed… Read More
Given a tree with the weights of all the nodes, the task is to find the maximum weighing node whose weight has even digit sum.… Read More
Given a weighted tree, the task is to count the number of nodes whose sum of digits of weights is a Prime Number.Examples:  Input:   Output:… Read More
Given a graph with N nodes and E edges, the task is to count the number of clique having their size as a prime number… Read More