Skip to Content
Mini Arrow Down Icon
Codecademy Logo
Search Icon
Codecademy Logo
Menu Icon
Codecademy Logo
Cheatsheets
/
Learn Data Structures and Algorithms with Python
Greedy Algorithms
Download Icon
Print
Cheatsheet
Share Icon
Share
Arrow Chevron Down Filled Icon
Topics
Arrow Chevron Down Icon
Nodes
Linked Lists
Doubly Linked Lists
Queues
Stacks
Hash Maps
Recursion
Asymptotic Notation
Pattern Searching
Sorting Algorithms
Brute Force Algorithms
Trees
Tree Traversal: Breadth-First Search and Depth-First Search
Divide and Conquer
Heaps and Heapsort
Graphs and Graph Search
Greedy Algorithms
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
Mini Arrow Left Icon
Previous
Download Icon
Print
Cheatsheet
Share Icon
Share
Arrow Chevron Down Filled Icon
Learn More on Codecademy
course
Learn Data Structures and Algorithms with Python
Intermediate
,
37
Lessons
career path
Computer Science
Beginner friendly
,
82
Lessons