Given a list of exam and assignments with deadlines and marks, arrange the sequence of doing the tasks to get the maximum marks.
- A task can be done within one day.
- Only able to do one task in a day
- Every task can start at any day before its deadline.
- The marks will be earned after the task is completed.
For each task, choose the day which is the closest to the deadline from list of available days.
For each day, choose the task with the highest marks from list of unassigned tasks.
Used binary search tree and greedy algorithm for both approaches to find the optimal choice for each day/task. Both approaches give the same result.
The time complexity for both algorithm are O(n log(n)). 🌟