Skip to content

Category Archives: Recursion

Given a binary tree consisting of N nodes, the task is to replace each node in the binary tree with the sum of its preorder… Read More
Given an array arr[] consisting of N positive integers and a positive integer X, the task is to check if the sum of the given… Read More
Given a binary string S and an array A[], both of size N, the task is to find the maximum score possible by removing substrings… Read More
Given two strings text and pattern of length M and N respectively, the task is to check if the pattern matches the text or not.… Read More
Given two positive integers N and S, the task is to count the number of unique outcomes possible when S flip operations are performed on… Read More
Given a binary matrix mat[][] that represents the adjacency matrix representation of a graph, where mat[i][j] as 1 represents that there is an edge between… Read More
Given a 2D array Edges[][], representing a directed edge between the pair of nodes in a Directed Acyclic Connected Graph consisting of N nodes valued… Read More
Given two integers N and K, the task is to find all valid combinations of K numbers that adds up to N based on the… Read More
In this article, we will discuss the approach to create an E-Library Management System where the user has the following options: Add book information. Display… Read More
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to find the minimum difference between the sum… Read More
Given a Binary Tree consisting of N nodes and a integer K, the task is to find the depth and height of the node with… Read More
Given an array arr[] consisting of N integers, the task is to sort the given array by using Bubble Sort without using loops. Examples: Input:… Read More
Given two arrays A[] and B[], both of size N, the task is to generate a sequence of length N comprising elements from the two… Read More
Given a Binary Tree consisting of N nodes, valued from 1 to N, rooted at node 1, the task is for each node is to… Read More
Given an undirected graph consisting of V vertices and a 2d array E[][2] denoting edges between pairs of nodes. Given another array arr[] representing values… Read More