## Find the Missing Number in a sorted array

Given a list of n-1 integers and these integers are in the range of 1 to n. There are no duplicates in list. One of… Read More »

## Number of possible pairs of Hypotenuse and Area to form right angled triangle

Given two arrays H and S. The array H[] contains the length of the hypotenuse and the array S[] contains Area of a right-angled triangle.… Read More »

## Eggs dropping puzzle (Binomial Coefficient and Binary Search Solution)

Given n eggs and k floors, find the minimum number of trials needed in worst case to find the floor below which all floors are… Read More »

## First strictly smaller element in a sorted array in Java

Given a sorted array and a target value, find the first element that is strictly smaller than given element. Examples: Input : arr[] = {1,… Read More »

## Number of elements smaller than root using preorder traversal of a BST

Given a preorder traversal of a BST. The task is to find the number of elements less than root. Examples: Input: preorder[] = {3, 2,… Read More »

## First element greater than or equal to X in prefix sum of N numbers using Binary Lifting

Given an array of N integers and a number X. The task is to find the index of first element which is greater than or… Read More »

## Search equal, bigger or smaller in a sorted array in Java

Given array of sorted integer, search key and search preferences find array position. A search preferences can be: 1) EQUAL – search only for equal… Read More »

## Find the index of an array element in Java

Given an array of N elements and an element K, find the index of an array element in Java. Examples: Input: a[] = { 5,… Read More »

## Variants of Binary Search

Binary search is very easy right? Well, binary search can become complex when element duplication occurs in the sorted list of values. It’s not always… Read More »

## Bank of America (BA) Continuum India Pvt Ltd. Interview Experience

Recently, BA Continuum India visited our campus for recruitment. There were total 4 rounds. Round 1: This round was a general aptitude test, which consisted… Read More »

## Shortest distance between two nodes in an infinite binary tree

Consider you have an infinitely long binary tree having a pattern as below: 1 / \ 2 3 / \ / \ 4 5 6… Read More »

## Subarray whose sum is closest to K

Given an array of positive and negative integers and an integer K. The task is to find the subarray which has its sum closest to… Read More »

## Longest Subarray with first element greater than or equal to Last element

Given an array arr[0..n-1] of n integers, find the maximum length subarray such that its first element is greater than or equal to the last… Read More »

## Longest subarray having average greater than or equal to x

Given an array of integers and an integer x. Find length of maximum size subarray having average of integers greater than or equal to x.… Read More »

## Largest subarray having sum greater than k

Given an array of integers and a value k, find length of largest subarray having sum greater than k. Examples: Input : arr[] = {-2,… Read More »