Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
The greedy algorithm makes the best choice at each step, hoping that these local optimal choices lead to a global optimal solution.
Greedy doesn't always work! For example, the greedy choice in the 0/1 Knapsack problem leads to a sub-optimal solution. Always verify your greedy logic with a proof or multiple test cases.