# Category Archives: Divide and Conquer

## Easy way to remember Strassen’s Matrix Equation

Strassen’s matrix is a Divide and Conquer method that helps us to multiply two matrices(of size n X n). You can refer to the link,… Read More »

## Find the Rotation Count in Rotated Sorted array

Consider an array of distinct numbers sorted in increasing order. The array has been rotated (anti-clockwise) k number of times. Given such an array, find… Read More »

## Minimum difference between adjacent elements of array which contain elements from each row of a matrix

Given a matrix of N rows and M columns, the task is to find the minimum absolute difference between any of the two adjacent elements… Read More »

## Find bitonic point in given bitonic sequence

You are given a bitonic sequence, the task is to find Bitonic Point in it. A Bitonic Sequence is a sequence of numbers which is… Read More »

## Find the only repeating element in a sorted array of size n

Given a sorted array of n elements containing elements in range from 1 to n-1 i.e. one element occurs twice, the task is to find… Read More »

## Floor in a Sorted Array

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 »

## Find cubic root of a number

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 »

## Find frequency of each element in a limited range array in less than O(n) time

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 »

## Longest Common Prefix | Set 3 (Divide and Conquer)

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

## Square root of an integer

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 »

## Find the element that appears once in a sorted array

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 »

## Divide and Conquer | Set 7 (The Skyline Problem)

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 »

## Divide and Conquer | Set 6 (Tiling Problem)

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 »

## Find the missing number in Arithmetic Progression

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

## Multiply two polynomials

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