Learning Experience
Greedy Algorithms
Make the locally-best choice at every step, never reconsider it, and — for the specific class of problems where this provably reaches the global optimum — end up with the right answer in a single pass.
Computer ScienceAdvanced8 min readalgorithmsoptimizationgraphs
Before you start
Prerequisite
Graph Traversal (BFS & DFS)
Two ways to visit every reachable node in a graph — breadth-first spreads outward level by level, depth-first commits to one path and backtracks.
Prerequisite
Heaps & Priority Queues
A complete binary tree, stored flat in an array, that keeps the smallest (or largest) element one O(log n) extraction away — the standard way to build a priority queue.
Your learning journey
Every module Axiom offers for greedy algorithms — work through them in order, or jump to what you need.
TopicLiveUp next
Explains the greedy choice property, exchange arguments, Activity Selection, Huffman coding, and MST intuition.
QuizLive
Checks recognition of when greedy provably fails (0/1 Knapsack, general Coin Change), not just when it works.
AI TutorLive
Answers follow-up questions and adapts the explanation to the learner's level.
Cheat SheetLive
One-glance recall of the greedy choice property and the classic problem shapes.
Related concepts
Dynamic Programming
Turn exponential recursion into polynomial time by caching the answer to every subproblem the first time it's solved, so it's never recomputed.
Dijkstra's Algorithm
Find the shortest distance from one start node to every other node in a weighted graph, by always finalizing the nearest unvisited node next and relaxing its edges.