· 1 min read
Greedy Algorithm
Greedy algorithms are simple and intuitive. They make a series of choices, each of which is the best choice at the time, and they never look back. This post will help you understand the concept of greedy algorithms and how to solve problems using them.
What is Greedy Algorithm?
The CLRS books says:
Like dynamic-programming algorithms, greedy algorithms typically apply to optimization problems in which you make a set of choices in order to arrive at an optimal solution. The idea of a greedy algorithm is to make each choice in a locally optimal manner, resulting in a faster algorithm than you get with dynamic programming.