Greedy algorithms are algorithms that make the best choice at each step in the hope that the best choice will lead to the global optimal solution. Greedy algorithms are used for optimization problems. An optimization problem can be solved using Greedy if the problem has the following two properties:
- Greedy Choice Property: A global optimal solution can be achieved by selecting a local optimal solution.
- Optimal Substructure: An optimal solution to the problem contains optimal solutions to the subproblems.
Greedy algorithms are implemented using a greedy function that makes the best choice at each step. The greedy function is implemented using a greedy strategy. A greedy strategy is a general plan of action that a greedy algorithm uses to make the best choice at each step.
- Maximum Subarray | Medium | Solution | Problem Description
- Jump Game | Medium | Solution | Problem Description
- Jump Game II | Medium | Solution | Problem Description
- Gas Station | Medium | Solution | Problem Description
- Hand of Straights | Medium | Solution | Problem Description
- Merge Triplets to Form Target Triplet | Medium | Solution | Problem Description
- Partition Labels | Medium | Solution | Problem Description
- Valid Parenthesis String | Medium | Solution | Problem Description
Category: Greedy
Status: In Progress
Author: David Bujosa