Codecademy Logo

Greedy Algorithms

Related learning

  • Learn what data structures and algorithms are, why they are useful, and how you can use them effectively in Python.
    • With Certificate
    • Intermediate.
      26 hours
  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours

Greedy Algorithms

  • A greedy algorithm solves an optimization problem by making the best decision at each step. This is known as the locally optimal decision.
  • Greedy algorithms are simple and efficient but are NOT always correct.
  • In order for a greedy algorithm to work, a problem must satisfy:
    • The optimal substructure property
    • The greedy property
Greedy solution to the largest path problem.

Learn more on Codecademy

  • Learn what data structures and algorithms are, why they are useful, and how you can use them effectively in Python.
    • With Certificate
    • Intermediate.
      26 hours
  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours