Skip to Content
Mini Arrow Down Icon
Loading menu bar
Loading menu bar
Codecademy Logo
Cheatsheets
/
CS102: Data Structures and Algorithms
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
Dynamic Programming
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
Next
Mini Arrow Right Icon
Download Icon
Print
Cheatsheet
Share Icon
Share
Arrow Chevron Down Filled Icon
Learn More on Codecademy
Course
Learn Data Structures and Algorithms with Python
Learn what data structures and algorithms are, why they are useful, and how you can use them effectively in Python.
Checker Dense
Certificate Icon
With
Certificate
Checker Dense
Level Icon
Intermediate
37
Lessons
Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
Checker Dense
Includes
6 Courses
Checker Dense
Certificate Icon
With
Professional Certification
Checker Dense
Level Icon
Beginner
Friendly
82
Lessons