Skip to content

Category Archives: Searching

You are given a 8*8 chess board. Along with the chess board there is a Bishop placed on board and its position is known. Position… Read More
Given an unsorted array of distinct elements. Task is to count number of cross lines formed in an array elements after sorting the array elements.… Read More
Quickselect is a selection algorithm to find the k-th smallest element in an unordered list. It is related to the quick sort sorting algorithm.Examples:  Input:… Read More
Given an array of unique integers where each integer of the given array lies in the range [1, N]. The size of array is (N-4).… Read More
Given an array of positive integers. We need to find how many triples of indices (i, j, k) (i < j < k), such that… Read More
Given n integers, which form a circle. Find the minimal absolute value of any adjacent pair. If there are many optimum solutions, output any of… Read More
Find the first, second and third minimum elements in an array in O(n). Examples: Input : 9 4 12 6 Output : First min =… Read More
Given an array of n integers, divide it into k segments and find the maximum of the minimums of k segments. Output the maximum integer… Read More
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
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
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
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
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
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
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