Divide and Conquer
Data Structure and Algorithms Course
Practice Problems on Divide and Conquer
Recent Articles on Divide and Conquer
Divide and Conquer is an algorithmic paradigm. A typical Divide and Conquer algorithm solves a problem using following three steps.
- Divide: Break the given problem into subproblems of same type.
- Conquer: Recursively solve these subproblems
- Combine: Appropriately combine the answers
A classic example of Divide and Conquer is Merge Sort demonstrated below. In Merge Sort, we divide array into two halves, sort the two halves recursively, and then merge the sorted halves.
Topics :
- Intoduction to Divide and Conquer
- Binary Search
- Randomized Binary Search Algorithm
- Merge Sort
- Quick Sort
- Tiling Problem
- Count Inversions
- Calculate pow(x, n)
- Closest Pair of Points
- Closest Pair of Points | O(nlogn) Implementation
- Multiply two polynomials
- Strassen’s Matrix Multiplication
- The Skyline Problem
- Maximum Subarray Sum
- Longest Common Prefix
- Search in a Row-wise and Column-wise Sorted 2D Array
- Karatsuba algorithm for fast multiplication
- Convex Hull (Simple Divide and Conquer Algorithm)
- Quickhull Algorithm for Convex Hull
- Distinct elements in subarray using Mo’s Algorithm
- Median of two sorted arrays
- Median of two sorted arrays of different sizes
- Floor in a Sorted Array
- Find closest number in array
- Find a Fixed Point in a given arrray
- Find a peak element in a given array
- Check for Majority Element in a sorted array
- K-th Element of Two Sorted Arrays
- Find the Rotation Count in Rotated Sorted array
- Find the minimum element in a sorted and rotated array
- Find the only repeating element in a sorted array of size n
- Find index of an extra element present in one sorted array
- Find the element that appears once in a sorted array
- Count number of occurrences (or frequency) in a sorted array
- Find the maximum element in an array which is first increasing and then decreasing
- Decrease and Conquer
- Binary Search using pthread
- Binary Search on Singly Linked List
- The painter’s partition problem
- The painter’s partition problem | Set 2
- Find the number of zeroes
- Numbers whose factorials end with n zeros
- Find the missing number in Arithmetic Progression
- Number of days after which tank will become empty
- Find bitonic point in given bitonic sequence
- Find the point where a monotonically increasing function becomes positive first time
- Iterative Tower of Hanoi
- Program for Tower of Hanoi
- Square root of an integer
- Find cubic root of a number
- Allocate minimum number of pages
- Collect all coins in minimum number of steps
- Modular Exponentiation (Power in Modular Arithmetic)
- Find a peak element in a 2D array
- Program to count number of set bits in an (big) array
- Maximum and minimum of an array using minimum number of comparisons
- Find frequency of each element in a limited range array in less than O(n) time
- Minimum difference between adjacent elements of array which contain elements from each row of a matrix
- Search element in a sorted matrix
- Easy way to remember Strassen’s Matrix Equation
- Largest Rectangular Area in a Histogram | Set 1
- Advanced master theorem for divide and conquer recurrences
- Place k elements such that minimum distance is maximized
- Iterative Fast Fourier Transformation for polynomial multiplication
- Write you own Power without using multiplication(*) and division(/) operators
- Sequences of given length where every element is more than or equal to twice of previous
- Shuffle 2n integers in format {a1, b1, a2, b2, a3, b3, ……, an, bn} without using extra space
- ‘Practice Problems’ on Divide and Conquer
- ‘Quizzes’ on Divide and Conquer
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.