Job Sequencing with Deadlines
Richest job first, placed in the latest free slot before its deadline; no free slot means it is dropped.
Decision · step 2 of 7Intervals and Greedy Choices: Job sequencing with deadlines
Job a, profit 100, deadline 2: slot 2 is free, so it goes there. Total profit 100.
What you will see
Slots on a timeline; each job walks back from its deadline to the first empty slot.
Cost
| Best | O(n log n) |
|---|---|
| Average | O(n^2) |
| Worst | O(n^2) |
| Space | O(n) |
O(n log n) with union-find over slots.
How you work with it here
play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next.
Screen readers: Candidates announce their key and state (candidate, chosen, rejected); each step announces the local choice and its consequence.
Reduced motion: Chosen and rejected states crossfade; no travelling emphasis.
Before this
Related
Taught by the same lesson
Intervals and Greedy Choices covers these too, in the same run.