Given an N×N matrix mat[][] and an integer K, the task is to search K in mat[][] and if found return its indices. Examples: Input:… Read More

# Category Archives: Searching

Given an array A[] of N integers, the task is to find the number of pairs of indices (1 ≤ i, j ≤ N) in… Read More

Given a string s of lowercase English alphabets and integer K. the task is to check if each character after increasing their ASCII by K… Read More

Given an array arr[] of distinct elements size N that is sorted and then around an unknown point, the task is to count the number… Read More

Given a binary matrix Mat[][] of size N*N, the task is to find the minimum number of flips to be performed such that the matrix… Read More

Given an array arr[] of size N, the task is to find the last element remaining after removing all elements closest to sum/2 sequentially where… Read More

Given two snapshots S1 and S2 of N elements, the task is to find the elements which are changing their groups and the ones that… Read More

A bike race is being organised with N bikers. The initial speed and the acceleration of the bikers are given in arrays H[] and A[]… Read More

There are many ways for checking whether the array contains any specific value or not, one of them is: Examples: Input: arr[] = {10, 30,… Read More

Given a 2-dimensional integer array arr[] representing N ranges, each of type [starti, endi] (starti, endi ≤ 109) and Q queries represented in array query[],… Read More

Given a string s of length N, containing digits written in words but in jumbled form, the task is to find out the digits present… Read More

Given a stack of M elements and a queue of N elements in sorted order. The task is to find out the common elements of… Read More

Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is stored. Mainly the widely used… Read More

Given a binary tree, a target node and a positive integer K on it, the task is to find the sum of all nodes within… Read More

Given an array A[] containing N elements of an array and their frequency in that array (say arr[]), the task is to find the median… Read More