Skip to content

Category Archives: Searching

Super-prime numbers (also known as higher order primes) are the subsequence of prime numbers that occupy prime-numbered positions within the sequence of all prime numbers.… Read More
Given an array of integers, find the minimum (or maximum) element and the element just greater (or smaller) than that in less than 2n comparisons.… Read More
Given an array of integers arr[0..n-1], count all pairs (arr[i], arr[j]) in the such that i*arr[i] > j*arr[j], 0 =< i < j < n.… Read More
  Prerequisite: Linear Search Binary Search LINEAR SEARCH Assume that item is in an array in random order and we have to find an item.… Read More
Linear Search is defined as a sequential search algorithm that starts at one end and goes through each element of a list until the desired… Read More
Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[].  ALGORITHM :Step 1: Start Step 2: Declare… Read More
Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[].  ALGORITHM :Step 1: Start Step 2: Declare… Read More
Given a sorted array of n uniformly distributed values arr[], write a function to search for a particular element x in the array. Linear Search finds… Read More
Like Binary Search, Jump Search is a searching algorithm for sorted arrays. The basic idea is to check fewer elements (than linear search) by jumping… Read More
Prerequisite : Structures in CName and marks in different subjects (physics, chemistry and maths) are given for all students. The task is to compute total… Read More
Given an array of n integers, find the third largest element. All the elements in the array are distinct integers. Example :  Input: arr[] = {1,… Read More
Given a sorted array and a value x, the floor of x is the largest element in the array smaller than or equal to x.… Read More
I’d like to share my MakeMyTrip interview experience with GeeksforGeeks. I interviewed with MakeMyTrip in Bangalore in the month of July, 2016. Round 1 Given… Read More
Given a N x N binary matrix (elements in matrix can be either 1 or 0) where each row and column of the matrix is… Read More
Given a string and a pattern, replace multiple occurrences of a pattern by character ‘X’. The conversion should be in-place and the solution should replace… Read More