# Divide and Conquer Paradigm (What it is, Its Applications, Pros and Cons)

In this article, we are going to learn the **concept of divide and conquer programming paradigm and its algorithms along with its applications**.

Submitted by Deepak Dutt Mishra, on June 30, 2018

In the branch of Computer Science and Engineering, Information Technology and all the associated branches among these fields the term **"Divide and Conquer"** is an algorithm design paradigm based on the principle of recursion ( multi-branched). In this algorithmic approach, the algorithm designed works recursively by breaking down the problem in hand, into two or more sub-problems or parts based on the complexity of the problem. This sub-problems or parts are also called atomic or fractions. This atomics or fractions are recursively broken down into more and more atomic or fractions until they are broken down into a form that can be solved. After solving these fractions or atomics they are then again traversed back recursively but this time instead of breaking down the problem, the problems are merged back with their recursively broken counterparts then the required solution for that particular problem is generated.

**Divide and Conquer Approach** is divided into three processes and these three processes form the basis of divide and conquer paradigm for problem-solving:

### 1) Divide

The first and foremost process for solving any problem using Divide and Conquer paradigm. As suggested by the name it’s function is just to divide the problem into sub-problem which in turn if are more complex then are again divided into more sub-parts. Basically , if we consider for example binary search ( an example of Divide and Conquer approach ) the given list is broken ( under some specified consider defined by its algorithm and user input ) into single elements among which then the element to search is compared and the user gets a prompt whether the element is in the list.

### 2) Conquer

This process is referred to as ‘ Conquer ’ because this process is what which performs the basic operation of a defined algorithm like sort in cases of various sorts, finds the element to be searched in case of binary search, multiplying of the numbers in Karatsuba Algorithm and etc. But almost among algorithms at least the most basic ones that we study mostly are considered to be solved in this part since the divide part breaks them into single elements which can be simply solved.

### 3) Merge

This is the last process of the **'Divide'** and **'Conquer'** approach whose function is to recursively rebuild the original problem but what we get now is the solution to that problem. In merge procedure, the solved elements of the ‘ Conquer ‘ are recursively merged together like the way they divided in the first step i.e. ‘ Divide’.

The steps **'Conquer'** and **'Merge'** work so close that sometimes they are treated as a single step. The Divide and Conquer can be implemented in two ways:

**Naturally**i.e. by using recursion**Explicitly**i.e. by using data structures like stack and queues etc

One of the major **characteristics of Divide and Conquer** is that the time complexity of its algorithms can be easily calculated by solving recurrence relations and its correctness can be evaluated via Mathematical Induction.

## Applications of Divide and Conquer Strategy

- Binary Search (C program for binary search)
- Merge Sort (Merge sort | C++ Example)
- Quick Sort (Quick sort | C++ Example)
- Closest Pair of Points
- Strassen’s Multiplication
- Karatsuba Algorithm
- Cooley-Tukey Algorithm

### Pros of Divide and Conquer Strategy

- Solves difficult problems with ease.
- Algorithms designed with Divide and Conquer strategies are efficient when compared to its counterpart Brute-Force approach for e.g. if we compare time complexity of simple matrix multiplication i.e. O(n3) and that of Strassen's matrix multiplication i.e. O(n2.81).
- Algorithms designed under Divide and Conquer strategy does not require any modification as they inhibit parallelism and can easily be processed by parallel processing systems.
- It makes efficient use of memory cache this happens so because that problems when divided gets so small that they can be easily solved in the cache itself.
- If we use floating numbers then the results may improve since round off control is very efficient in such algorithms.

### Cons of Divide and Conquer Strategy

**Divide and Conquer**strategy uses recursion that makes it a little slower and if a little error occurs in the code the program may enter into an infinite loop.- Usage of explicit stacks may make use of extra space.
- If performing a recursion for no. times greater than the stack in the CPU than the system may crash.
- Choosing base cases is also a limitation as picking small cases may work if the cases are taken much higher than the capacity of the system than problems may occur.
- Sometimes a case where the problem when broken down results in same subproblems which may needlessly increase the solving time and extra space may be consumed.

**Quick links:**

C FAQ(s)
C Advance programs
C/C++ Tips & Tricks
Puzzles
JavaScript
CSS
Python
Linux Commands
PHP
Android
Articles
More...

**Featured post:**

Introduction to Linux (Its modes, Safety, Most popular Applications)

Linux Best Distribution Software (Distros) of 2018

Was this page helpful? Please share with your friends...

Are you a blogger? Join our Blogging forum.

Comments and Discussions