0% found this document useful (0 votes)
24 views

Apex Institute of Technology Department of Computer Science & Engineering

This document summarizes the divide and conquer algorithm design pattern. It defines divide and conquer as breaking a problem down into smaller subproblems, solving those subproblems, and then combining the solutions to solve the original problem. Some key applications mentioned include binary search, quicksort, merge sort, and FFT algorithms. Advantages are speed and efficiency due to parallel processing, while disadvantages include high memory usage due to recursion.

Uploaded by

Angad S
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Apex Institute of Technology Department of Computer Science & Engineering

This document summarizes the divide and conquer algorithm design pattern. It defines divide and conquer as breaking a problem down into smaller subproblems, solving those subproblems, and then combining the solutions to solve the original problem. Some key applications mentioned include binary search, quicksort, merge sort, and FFT algorithms. Advantages are speed and efficiency due to parallel processing, while disadvantages include high memory usage due to recursion.

Uploaded by

Angad S
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Apex Institute of Technology

Department of Computer Science & Engineering


Bachelor of Engineering (Computer Science & Engineering)
Design and Analysis of Algorithms– (20CST-282)
Prepared By: Dr. Vipin Tiwari (E10753)

03/07/2022 DISCOVER . LEARN . EMPOWER


1
Divide and conquer algorithms

• 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:

There are two fundamental of Divide & Conquer Strategy:


Relational Formula
Stopping Condition
1. Relational Formula: It is the formula that we generate from the given
technique. After generation of Formula we apply D&C Strategy, i.e. we
break the problem recursively & solve the broken subproblems.
2. Stopping Condition: When we break the problem using Divide &
Conquer Strategy, then we need to know that for how much time, we
need to apply divide & Conquer. So the condition where the need to
stop our recursion steps of D&C is called as Stopping Condition.

5
Applications of Divide and Conquer Approach:

• Following algorithms are based on the concept of the Divide and


Conquer Technique:
• Binary Search 
• Quicksort
• Merge Sort
• Strassen's Algorithm
• Cooley-Tukey Fast Fourier Transform (FFT) algorithm
• Karatsuba algorithm for fast multiplication

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

• Since most of its algorithms are designed by incorporating recursion,


so it necessitates high memory management.
• An explicit stack may overuse the space.
• It may even crash the system if the recursion is performed rigorously
greater than the stack present in the CPU.

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

You might also like