Job Scheduling Algorithm

Greedy Approach for Maximum Profit Optimization

Added Jobs

0 jobs
Job ID Deadline Profit Actions

No jobs added yet

Add your first job to get started

Algorithm Analysis

Algorithm Steps

  1. Sort all jobs in descending order of profit
  2. Find the maximum deadline among all jobs
  3. Create a time slot array to track assigned jobs
  4. For each job, find the latest available slot before its deadline
  5. Assign job to the slot if available
  6. Calculate total profit of assigned jobs

Time Complexity

O(n²) - Sorting takes O(n log n) and slot assignment takes O(n²) in worst case

Space Complexity

O(n) - Additional space for storing time slots and result