Skip to content

Category Archives: Recursion

Given two positive integers A and B. The task is to minimize operations required to reduce A and B to 1. There are two types… Read More
Given a Binary Tree, the task is to convert the given Binary Tree to the Symmetric Tree by adding the minimum number of nodes in… Read More
Given a N x N chessboard with a Knight initially standing on the Xth row and Yth column, the task is to print all possible… Read More
Given a positive integer K and a weighted undirected connected graph of N nodes and E edges as an array Edges[] of the type {u,… Read More
Given an array arr[] of N integers, the task is to find the number of jumps required to escape the array arr[] for all values… Read More
Given a root of the Binary Tree and head of the Linked List, the task is to check if all the elements of the linked… Read More
Given root of the Binary Tree T and a linked list L, the task is to find the direction of path followed from root such… Read More
Given an undirected, connected tree with N nodes valued from 0 to N – 1 and an array edges[][2] represents the edges between two nodes,… Read More
Given a 2D array arr[][] of size M*N containing 1s and 0s where 1 represents that the cell can be visited and 0s represent that… Read More
Given an integer N and an array arr[] having M integers, the task is to find the maximum size of the subset such that the… Read More
Given a positive integer N representing N stairs and a person it at the first stair, the task is to print all ways to reach… Read More
Given a string S of size N consisting of digits and ?, the task is to find the number of strings formed such that replacing… Read More
Given three positive integers A, B, and K, the task is to find the Kth lexicographically smallest binary string that contains exactly A number of… Read More
Given a tree consisting of N nodes an array edges[][3] of size N – 1 such that for each {X, Y, W} in edges[] there… Read More
Given a Binary Tree consisting of N nodes having no values in it and an integer X, that represents the value of the root node,… Read More