Skip to content

Category Archives: Searching

Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[]. C/C++ #include <bits/stdc++.h> using namespace std;… Read More
Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[]. Java // Java code for linearly… Read More
Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[]. Examples :   Input : arr[] =… 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[] =… Read More
Given a sorted array and a value x, the floor of x is the largest element in array smaller than or equal to x. Write… 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 solution should replace multiple… Read More
I was recently interviewed by Amazon, Bangalore for SDE position. It was an off campus drive in Delhi for TRMS team. Written Test : Q1)… Read More
Paytm Hiring Drive for Backend Engineer. The selection process was completed on the same day. Round 1 ( Written ): It was a technical written… Read More
Given a sorted array arr[] of size n and an element x to be searched in it. Return index of x if it is present… Read More
A rational is represented as p/qb, for example 2/3. Given a sorted array of rational numbers, how to search an element using Binary Search. Use… Read More