##
Find cubic root of a number
July 3, 2016

Given a number n, find the cube root of n. Examples: Input: n = 3 Output: Cubic Root is 1.442250 Input: n = 8 Output:… Read More »

July 3, 2016

Given a number n, find the cube root of n. Examples: Input: n = 3 Output: Cubic Root is 1.442250 Input: n = 8 Output:… Read More »

June 29, 2016

Given an sorted array of positive integers, count number of occurrences for each element in the array. Assume all elements in the array are less… Read More »

June 22, 2016

Given a set of strings, find the longest common prefix. Input : {“geeksforgeeks”, “geeks”, “geek”, “geezer”} Output : “gee” Input : {“apple”, “ape”, “april”} Output… Read More »

October 5, 2015

Given an integer x, find square root of it. If x is not a perfect square, then return floor(√x). Examples: Input: x = 4 Output:… Read More »

July 12, 2015

Given a sorted array in which all elements appear twice (one after one) and one element appears only once. Find that element in O(log n)… Read More »

March 8, 2015

Given n rectangular buildings in a 2-dimensional city, computes the skyline of these buildings, eliminating hidden lines. The main task is to view buildings from… Read More »

March 4, 2015

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 »

January 8, 2015

Given an array that represents elements of arithmetic progression in order. One element is missing in the progression, find the missing number.

November 12, 2014

Given two polynomials represented by two arrays, write a function that multiplies given two polynomials.

April 27, 2014

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 »

April 6, 2014

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 »

March 29, 2014

Given two square matrices A and B of size n x n each, find their multiplication matrix.

January 28, 2014

Given a sorted array arr[] of n elements, write a function to search a given element x in arr[].

January 7, 2014

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.

November 28, 2013

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 »