Greedy Algorithms
Algorithms that make locally optimal choices at each step.
Algorithms that make locally optimal choices at each step.
Greedy algorithms and the problems they solve: activity selection, Huffman coding, Dijkstra, Kruskal, fractional knapsack and job sequencing, extended with Prim's and Boruvka's spanning-tree algorithms, canonical coin change, optimal merge patterns and greedy set-cover approximation.
| Algorithm | Use case |
|---|---|
| Activity Selection | Select maximum compatible activities given start and end times. |
| Huffman Coding | Build optimal prefix-free binary encoding for symbols. |
| Dijkstra Shortest Path | Find shortest paths from a source in graphs with non-negative weights. |
| Kruskal MST | Build minimum spanning tree by adding cheapest edges. |
| Fractional Knapsack | Maximize value when items can be broken into fractions. |
| Job Sequencing | Schedule jobs with deadlines to maximize profit. |
| Prim's MST | Grow a minimum spanning tree by repeatedly adding the cheapest edge that connects a new vertex. |
| Boruvka's MST | Build a minimum spanning tree by adding the cheapest outgoing edge of every component in parallel rounds. |
| Coin Change (canonical systems) | Make change with the fewest coins using the largest coin first; optimal only for canonical coin systems such as US coins. |
| Optimal Merge Pattern | Merge sorted files with minimum total cost by always merging the two smallest. |
| Greedy Set Cover | Approximate the smallest collection of sets covering all elements by repeatedly picking the set that covers the most uncovered elements. |
The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.
| Section | Field | Type | Example |
|---|---|---|---|
| data | algorithm | string | Activity Selection |
| data | use_case | string | Select maximum compatible activities given star… |
The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.
curl "https://yjtoon.yunusemrevurgun.com/api/dataset/greedy-algorithms?format=toon"
const res = await fetch( "https://yjtoon.yunusemrevurgun.com/static-data/dataset/greedy-algorithms.toon" ); const toon = await res.text();
Rate limit: 120 requests per minute per IP, no key and no signup. API reference →