# Category Archives: Searching

## k-th missing element in increasing sequence which is not present in a given sequenceOctober 17, 2017

Given two sequences, one is increasing sequence a[] and another a normal sequence b[], find the K-th missing element in the increasing sequence which is… Read More »

## Count number of elements between two given elements in arrayOctober 16, 2017

Given an unsorted array of n elements and also given two points num1 and num2. The task is to count number of elements occurs between… Read More »

## Sort a Rotated Sorted ArrayOctober 11, 2017

You are given a rotated sorted array and your aim is to restore its original sort in place. Expected to use O(1) extra space and… Read More »

## Count ways of choosing a pair with maximum differenceOctober 8, 2017

Given an array of n integers, we need to find the no. of ways of choosing pairs with maximum difference. Examples: Input : a[] =… Read More »

## Minimum product pair an array of positive IntegersSeptember 29, 2017

Given an array of positive integers. We are required to write a program to print the minimum product of any two numbers of the given… Read More »

## Find row number of a binary matrix having maximum number of 1sSeptember 9, 2017

Given a binary matrix (containing only 0 and 1) of order n*n. All rows are sorted already, We need to find the row number with… Read More »

## Best meeting point in 2D binary arraySeptember 6, 2017

You are given a 2D grid of values 0 or 1, where each 1 marks the home of someone in a group. And the group… Read More »

## Find element in a sorted array whose frequency is greater than or equal to n/2.August 30, 2017

Given a sorted array of length n, find the number in array that appears more than or equal to n/2 times. It is given that… Read More »

## Find a triplet such that sum of two equals to third elementAugust 25, 2017

Given an array of integers you have to find three numbers such that sum of two elements equals the third element. Examples: Input : {5,… Read More »

## Repeatedly search an element by doubling it after every successful searchAugust 24, 2017

Given an array “a[]” and integer “b”. Find whether b is present in a[] or not. If present, then double the value of b and… Read More »

## Check if an array contains all elements of a given rangeJuly 16, 2017

An array containing positive elements is given. ‘A’ and ‘B’ are two numbers defining a range. Write a function to check if the array contains… Read More »

## Squareroot(n)-th node in a Linked ListJuly 12, 2017

Given a Linked List, write a function that accepts the head node of the linked list as a parameter and returns the value of node… Read More »

## All unique triplets that sum up to a given valueJuly 6, 2017

Given an array and a sum value, find all possible unique triplets in that array whose sum is equal to the given sum value. If… Read More »

## Count quadruples from four sorted arrays whose sum is equal to a given value xJuly 4, 2017

Given four sorted arrays each of size n of distinct elements. Given a value x. The problem is to count all quadruples(group of four numbers)… Read More »

## Search an element in an unsorted array using minimum number of comparisonsJune 22, 2017

Given an array of n distinct integers and an element x. Search the element x in the array using minimum number of comparisons. Any sort… Read More »