Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 1.26 KB

Ep4-Greedy.md

File metadata and controls

23 lines (15 loc) · 1.26 KB

Part 1 Episode 4/4: Greedy Algorithms

As one might have understood from the title, a Greedy Algorithm is one that picks the locally optimal solution at each step of the algorithm.

What this means is that the algorithm does not care if the locally optimal solution is not globally optimal and goes ahead and picks the locally optimal solution anyways.

Thus, it is important for you, the programmer, to decide if a greedy strategy is the globally optimal strategy and only once you are able to prove that statement with a certain degree of confidence, you may go ahead and implement a greedy algorithm.


Here are some practice problems that can be solved using the greedy approach:

  1. Codeforces 1392 A
  2. Codeforces 1295 A
  3. Codeforces 1466 B
  4. Codeforces 514 A
  5. Codeforces 766 B

Challenge Problems:

  1. Codeforces 512 A
  2. Codeforces 1406 B