Skip to main content

Job Sequencing

Learn Job Sequencing (Greedy Algorithms, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Maximizing Profit with Deadlines Each job has a DEADLINE and a PROFIT; each job takes exactly 1 unit of time, and only one job can run at a time. Schedule jobs to maximize total profit. Greedy strategy: sort jobs by profit DESCENDING, then for each job, schedule it as LATE as possible (closest to its deadline, but still before it) - leaving earlier slots open for other jobs.

More lessons in Greedy Algorithms