A greedy algorithm is an approach for solving a problem by selecting the
best option available at the moment, without worrying about the future
result it would bring. In other words, the locally best choices aim at
producing globally best results. This algorithm never goes back to reverse the decision made. This algorithm works in a top-down approach.
The main advantage of this algorithm is:
- The algorithm is easier to describe.
- This algorithm can perform better than other algorithms.