Skip to Content
Loading menu bar
Loading menu bar
Search
Codecademy Logo
Cheatsheets
/
CS102: Data Structures and Algorithms
Greedy Algorithms
Print
Cheatsheet
Share
Topics
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
Previous
Next
Print
Cheatsheet
Share
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
With
Certificate
Checker Dense
Intermediate
26
hours
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
With
Professional Certification
Checker Dense
Beginner
Friendly
75
hours