1.0 - Dynamic Programming

2.0 - Greedy Problems

A greedy algorithm may be found for optimisation problems with

Greedy problems solve problems by making a greedy choice (locally optimal choice) and solving (only) the chosen sub-problem

2.1 - Greedy Choice Property

2.2 - Greedy Algorithms

🌱 Here are some of the Greedy Algorithms that we have already seen:

2.3 - Activity Selection Problem

🌱 Find the combination (subset) of tasks that maximises the number of activities in a finite amount of time:

Greedy-Activity-Selector(s, f) n = s.length A = { a1 } // The activity that finishes first k = 1 for m = 2 to n if s[m] >= f[k] A = A u { am } k = m return A

Proof

2.4 - Knapsack

2.4.1 - Fractional Knapsack

2.4.2 - Binary Knapsack