Skip to content

added scheduling algorithm#599

Merged
yanglbme merged 4 commits into
TheAlgorithms:masterfrom
shivg7706:scheduling
Oct 27, 2018
Merged

added scheduling algorithm#599
yanglbme merged 4 commits into
TheAlgorithms:masterfrom
shivg7706:scheduling

Conversation

@shivg7706

Copy link
Copy Markdown
Contributor

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

@shivg7706

Copy link
Copy Markdown
Contributor Author

@yanglbme Please review. Thanks

Comment thread Others/SJF.java
import java.util.ArrayList;
import java.util.Comparator;
import java.util.*;

Copy link
Copy Markdown
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

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

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

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@yanglbme yanglbme left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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