Divide and conquer (D&C) is an algorithm design paradigm based on multi-branched recursion. A divide and conquer algorithm works by recursively breaking down a problem into two or more subproblems of the same or related type until these become simple enough to be solved directly. The solutions to the subproblems are then combined to give a solution to the original problem.
In this post, we have listed out commonly asked interview questions that can be solved with the Divide and conquer technique:
- Merge Sort AlgorithmEasy
- Iterative Merge Sort Algorithm (Bottom-up Merge Sort)Medium
- Quicksort AlgorithmMedium
- Hybrid QuickSort AlgorithmMedium
- Quicksort using Dutch National Flag AlgorithmMedium
- Quicksort algorithm using Hoare’s partitioning schemeMedium
- Inversion count of an arrayHard
- Segregate positive and negative integers using merge sortMedium
- Iterative Implementation of QuicksortMedium
- Binary Search AlgorithmEasy
- Find the number of rotations in a circularly sorted arrayEasy
- Search an element in a circularly sorted arrayMedium
- Find the first or last occurrence of a given number in a sorted arrayEasy
- Count occurrences of a number in a sorted array with duplicatesMedium
- Find the smallest missing element from a sorted arrayMedium
- Find floor and ceil of a number in a sorted integer arrayEasy
- Search in a nearly sorted array in logarithmic timeMedium
- Find the number of 1’s in a sorted binary arrayEasy
- Find the peak element in an arrayMedium
- Maximum Subarray Sum using Divide and ConquerMedium
- Efficiently implement power functionEasy
- Find the missing term in a sequence in logarithmic timeMedium
- Find floor and ceil of a number in a sorted array (Recursive solution)Easy
- Find the frequency of each element in a sorted array containing duplicatesEasy
- Find the square root of a number using a binary searchEasy
- Division of two numbers using binary search algorithmMedium
- Find the odd occurring element in an array in logarithmic timeMedium
- Find pairs with difference
k
in an array | Constant Space SolutionMedium - Find
k
closest elements to a given value in an arrayMedium - Find the minimum and maximum element in an array using Divide and ConquerEasy
- Longest Common Prefix (LCP) ProblemEasy
- Binary Search in C++ STL and Java CollectionsBeginner
- Ternary Search vs Binary searchBeginner
- Exponential searchEasy
- Unbounded Binary SearchEasy
- Interpolation searchEasy
- Introsort Algorithm – Overview and C++ ImplementationHard
- Efficiently merge
k
sorted linked listsHard - Merge sort algorithm for a singly linked listHard
- Sort a doubly-linked list using merge sortMedium
- Find the square of a number without using the multiplication and division operatorEasy
Thanks for reading.
To share your code in the comments, please use our online compiler that supports C, C++, Java, Python, JavaScript, C#, PHP, and many more popular programming languages.
Like us? Refer us to your friends and support our growth. Happy coding :)