Skip to content

Category Archives: Searching

Given two strings str1 and str2, the task is to count the minimum number of operations of the following three types on one of the… Read More
Given a matrix mat[][] of size M * N, the task is to find all matrix elements which are minimum in their respective row and… Read More
Given a string S representing a sentence and another string word, the task is to find the word from S which has the string word… Read More
Given an n-ary tree T, the task is to find a node whose removal minimizes the maximum size of all forests(connected components) generated. Examples: Input:  … Read More
Given an array arr[], where each element represents the maximum number of steps that can be made forward from that element, the task is to… Read More
Given an array arr[] consisting of N integers, the task is to find the length of the longest increasing absolute even subsequence. An increasing absolute… Read More
Given a binary string S, the task is to find the minimum number of operations of flipping at most two non-adjacent characters from the binary… Read More
Given an array arr[] of N integers and an integer K, the task is to find a subarray of length K with a sum of… Read More
John is a geologist, and he needs to count rock samples in order to send it to a chemical laboratory. He has a problem. The… Read More
Given an array arr[] consisting of N integers, the task is to find the minimum length of the prefix needed to be deleted such that… Read More
Given an array arr[] of size N, and an integer K, the task is to find the count of array elements arr[i] which are greater… Read More
Given two integers N and K, the task is to find the minimum integer X that can be added to N so that the sum… Read More
Given two arrays arr[] and brr[] consisting of N integers, the task is to count the number of pairs (i, j) from both the array… Read More
Given two integers A and B, convert A to B by performing one of the following operations any number of times: A = A +… Read More
Given a binary tree, the task is to count the number of balanced nodes in the given tree. Balanced nodes of a binary tree are… Read More