Job Details
Added Jobs
0 jobs
| Job ID | Deadline | Profit | Actions |
|---|
No jobs added yet
Add your first job to get startedAlgorithm Analysis
Algorithm Steps
- Sort all jobs in descending order of profit
- Find the maximum deadline among all jobs
- Create a time slot array to track assigned jobs
- For each job, find the latest available slot before its deadline
- Assign job to the slot if available
- 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