Apex Institute of Technology Department of Computer Science & Engineering
Apex Institute of Technology Department of Computer Science & Engineering
• Definition
• Divide and Conquer is an algorithmic pattern. In algorithmic methods, the design is to
take a dispute on a huge input, break the input into minor pieces, decide the problem
on each of the small pieces, and then merge the piecewise solutions into a global
solution. This mechanism of solving the problem is called the Divide & Conquer
Strategy.
•P
• p1,p2,p3,p4-----pn
• s1,s2,s3,------sn
•S
• All sub-problems must be of same type as of P
• There must be some procedure to combine sub-solutions
2
Divide and Conquer
• Divide and Conquer algorithm consists of a dispute using the following three steps.
• Divide the original problem into a set of subproblems.
• Conquer: Solve every subproblem individually, recursively.
• Combine: Put together the solutions of the subproblems to get the solution to the
whole problem.
3
Divide and Conquer
4
Fundamental of Divide & Conquer Strategy:
5
Applications of Divide and Conquer Approach:
6
Advantages of Divide and Conquer
• ->Divide and Conquer tend to successfully solve one of the biggest problems, such
as the Tower of Hanoi, a mathematical puzzle. It is challenging to solve complicated
problems for which you have no basic idea, but with the help of the divide and
conquer approach, it has lessened the effort as it works on dividing the main
problem into two halves and then solve them recursively. This algorithm is much
faster than other algorithms.
• ->It efficiently uses cache memory without occupying much space because it solves
simple subproblems within the cache memory instead of accessing the slower main
memory.
• ->It is more proficient than that of its counterpart Brute Force technique.
• ->Since these algorithms inhibit parallelism, it does not involve any modification
and is handled by systems incorporating parallel processing.
7
Disadvantages of Divide and Conquer
8
References
• Fundamentals of Computer Algorithms 2nd Edition (2008) by Horowitz, Sahni
and Rajasekaran
• Introduction to Algorithms 3rd Edition (2012) by Thomas H Cormen, Charles E
Lieserson, Ronald
9
THANK YOU
For queries
Email: [email protected]
03/07/2022 10