Skip to content

added scheduling algorithm #599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 27, 2018
Merged

Conversation

shivg7706
Copy link
Contributor

Scheduling Algorithm - Priority and Shortest job first which solves the starvation

@shivg7706
Copy link
Contributor Author

@yanglbme Please review. Thanks

import java.util.ArrayList;
import java.util.Comparator;
import java.util.*;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, please add some descriptions about what the algorithm does. Thx

Others/SJF.java Outdated
remainingProcess = new ArrayList<Process>();

gantChart = new ArrayList<Integer>();
arrivals = new HashMap<Integer, ArrayList<Process>>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use Java 8, so you can simplify your code. Like this👇

gantChart = new ArrayList<>();
arrivals = new HashMap<>();

@shivg7706
Copy link
Contributor Author

@yanglbme made changes as mentioned by you. please review thanks

Copy link
Member

@yanglbme yanglbme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Java doc comments, please. See the following example:

/**
 * Shortest job first.
 *
 * <p>Shortest job first (SJF) or shortest job next, 
 * is a scheduling policy that selects the waiting process 
 * with the smallest execution time to execute next..........
 *
 * @author shivg7706
 * @since 2018/10/27
 */

@shivg7706
Copy link
Contributor Author

@yanglbme Please review.

@yanglbme yanglbme merged commit 2deeb8b into TheAlgorithms:master Oct 27, 2018
@shivg7706 shivg7706 deleted the scheduling branch October 27, 2018 07:35
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.

2 participants