Greedy Algorithm to find the maximum number of mutually compatible jobs
- Job j starts at s(j) and finishes at f(j)
- 2 jobs are compatible if they do not overlap (2nd job starts after or at the same time as the 1st one finishes)
- Goal: find the maximum number of mutually compatible jobs
- Example: 8 jobs {a, b, c, d, e, f, g, h}
Consider jobs in ascending order of finish time f(j)
Sorting O(n log(n)) + for-loop Θ(n)
O(n log(n))