Skip to content

Category Archives: Searching

Given an n x n matrix and an integer x, find the position of x in the matrix if it is present. Otherwise, print “Element… Read More
Given a sorted array and a value x, the ceiling of x is the smallest element in an array greater than or equal to x,… Read More
Write an efficient program for printing K largest elements in an array. Elements in an array can be in any order Examples: Input:  [1, 23,… Read More
Given an array of size N. The task is to find the maximum and the minimum element of the array using the minimum number of… Read More
Write an efficient C++/C program to find the smallest and second smallest element in an array.  Example:  Input: arr[] = {12, 13, 1, 10, 34,… Read More
Question: An Array of integers is given, both +ve and -ve. You need to find the two elements such that their sum is closest to… Read More
  There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after… Read More
Given a sorted and rotated array arr[] of size N and a key, the task is to find the key in the array. Note: Find… Read More
Given an array arr[] of size N-1 with integers in the range of [1, N], the task is to find the missing number from the… Read More

Start Your Coding Journey Now!