Skip to content

Conversation

Pruthviraj141
Copy link

We implement the Shortest Job Duration First algorithm using the Greedy technique by selecting the shortest job from the array. To always select the shortest job first we sort the job duration array in ascending order based on their duration.

Once the jobs are sorted, we iterate through each job in the sorted list. For each iteration the waiting time is the sum of the total time taken by all previous jobs. We calculate the waiting time for each job and update the total time taken by adding the duration of the current job to the total waiting time.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants