0% found this document useful (0 votes)
27 views6 pages

Comparison Between Greedy Divide and Conquer and Dynamic Programming Algorithms

Greedy-Divide-and-Conquer-and-Dynamic-Programming-Algorithms

Uploaded by

thesismacs9
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
27 views6 pages

Comparison Between Greedy Divide and Conquer and Dynamic Programming Algorithms

Greedy-Divide-and-Conquer-and-Dynamic-Programming-Algorithms

Uploaded by

thesismacs9
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 6

Comparison

between Greedy,
Divide and
Conquer, and
Dynamic
Programming
Welcome to our presentation on the comparison between
greedy, divide and conquer, and dynamic programming

Algorithms
algorithms. By understanding their characteristics, complexities,
applications, and advantages/disadvantages, we can choose the
most suitable algorithm for different problem-solving scenarios.

by Mehwish Iqbal
Greedy Algorithm
1 Definition and 2 Types of 3 Time and
Characteristic Problems Space
s Tackled Complexities
The greedy Greedy algorithms Greedy algorithms
algorithm makes are commonly used often have a time
locally optimal for problems like complexity of
choices at each finding minimum O(nlogn) and a
step to find a spanning trees or space complexity of
globally optimal scheduling tasks. O(n).
solution.
4 Applications
and Real- 5 Advantages and Disadvantages
world Examples
Greedy algorithms offer simplicity
Greedy algorithms find and efficiency but may not always
applications in various fields, such guarantee the optimal solution.
as network routing and
optimization problems.
Divide and Conquer Algorithm
Definition Types of Time and Applicatio
and Problems Space ns and
Character Tackled Complexit Real-
istics ies world
Divide and The time
conquer complexity of
Examples
The divide and Divide and
conquer algorithms are divide and conquer
algorithm breaks suitable for conquer algorithms find
down a problem problems like algorithms applications in
into smaller sorting, varies image
subproblems, searching, and depending on processing,
solves them calculating the problem, numerical
recursively, and Fibonacci typically ranging methods, and
combines the numbers. from O(nlogn) to parallel
solutions to O(n^2). Space algorithms.
solve the complexity is
generally O(n).
Dynamic Programming Algorithm

1 Definition and Characteristics

The dynamic programming


algorithm solves a problem by
Types of Problems Tackled 2 breaking it into overlapping
Dynamic programming subproblems and storing the
algorithms excel in problems intermediate results to avoid
like shortest path, matrix chain redundant computations.
multiplication, and knapsack.
3 Time and Space
Complexities

Dynamic programming
algorithms often have a time
Applications and 4 complexity of O(n^2) or
Real-world Examples
O(n^3). Space complexity is
Dynamic programming typically O(n).
algorithms find applications in
5 Advantages and
DNA sequencing, optimization
Disadvantages
problems, and resource
allocation. Dynamic programming
algorithms provide optimal
solutions by utilizing
previously computed results
but may require additional
space to store intermediate
values.
Table Form Comparison
Greedy Algorithm Divide and Dynamic
Conquer Programming
Algorithm Algorithm

Definition and Makes locally Divides Breaks problem


Characteristics optimal choices problem into into
subproblems overlapping
subproblems
Types of Minimum Sorting, Shortest path,
Problems spanning trees, searching, matrix chain
Tackled task scheduling Fibonacci multiplication,
knapsack
Time Complexity O(nlogn) O(nlogn) to O(n^2) O(n^2) or O(n^3)

Space Complexity O(n) O(n) O(n)

Applications Network Image DNA


routing, processing, sequencing,
optimization numerical optimization,
methods resource
Advantages Simplicity, efficiency Efficient solutions Optimal solutions
allocation

Disadvantages May not Additional Additional


guarantee space for space for
optimal recursion intermediate
solution values
Conclusion
Understanding the differences between greedy, divide and
conquer, and dynamic programming algorithms empowers us to
choose the most effective approach for solving various problems.
Whether simplicity and efficiency with greedy, or optimal
solutions with dynamic programming, each algorithm provides
unique advantages and applications.

You might also like