Divide and Conquer

Get an introduction to the divide and conquer paradigm.

The divide and conquer method

Divide and conquer is an algorithmic paradigm in which the problem is repeatedly divided into subproblems until each problem is similar and atomic, i.e., it can’t be further divided.

Atomic problem

Let’s solve a problem in which we have a list of uppercase and lowercase alphabets and need to convert them 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 three steps:

1. Divide

First, break the problem at hand into smaller subproblems. This step can be achieved by dividing the list containing the alphabet 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.