Divide and Conquer
Here is a quick introduction to the divide and conquer paradigm!
We'll cover the following
Divide and conquer method
Divide and conquer is an algorithmic paradigm in which the problem is repeatedly divided into subproblems until we reach a point where each problem is similar and atomic (i.e., can’t be further divided).
Atomic problem
Let’s solve a problem in which we have a list of uppercase and lowercase alphabets and the task is to convert it all into lowercase.
In this problem, we will start solving these atomic problems and combining (merging) the solutions. So, Divide and Conquer solutions have the following 3 steps:
1. Divide
First, break the problem at hand into smaller subproblems. This step can be achieved by dividing the list containing the alphabets into sublists until a single unit is left and no further division is possible.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.