Given a n by n board where n is of form 2k where k >= 1 (Basically n is a power of 2 with minimum… Read More »
Given an array that represents elements of arithmetic progression in order. One element is missing in the progression, find the missing number.
Given two polynomials represented by two arrays, write a function that multiplies given two polynomials.
Given an n x n matrix, where every row and column is sorted in increasing order. Given a key, how to decide whether this key… Read More »
Given an array of 1s and 0s which has all 1s first followed by all 0s. Find the number of 0s. Count the number of… Read More »
Given two square matrices A and B of size n x n each, find their multiplication matrix.
Given a sorted array arr of n elements, write a function to search a given element x in arr.
Like Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot.
We are given an array of n points in the plane, and the problem is to find out the closest pair of points in the… Read More »
A sorted array is rotated at some unknown point, find the minimum element in it. Following solution assumes that all elements are distinct.
Given a function ‘int f(unsigned int x)’ which takes a non-negative integer ‘x’ as input and returns an integer as output.
Given an array of integers. Find a peak element in it. An array element is peak if it is NOT smaller than its neighbors. For… Read More »
Given two binary strings that represent value of two integers, find the product of two strings. For example, if the first bit string is “1100”… Read More »
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. For simplicity,… Read More »
You are given a one dimensional array that may contain both positive and negative integers, find the sum of contiguous subarray of numbers which has… Read More »