Skip to content

Commit

Permalink
Rename shortest_job_first_algorithm.py to shortest_job_first.py (TheA…
Browse files Browse the repository at this point in the history
…lgorithms#2164)

* Rename shortest_job_first_algorithm.py to shortest_job_first.py

* updating DIRECTORY.md

* Minor tweek to round_robin.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
  • Loading branch information
cclauss and github-actions authored Jul 3, 2020
1 parent e274863 commit 2c98dce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@

## Scheduling
* [First Come First Served](https://github.com/TheAlgorithms/Python/blob/master/scheduling/first_come_first_served.py)
* [Shortest Job First Algorithm](https://github.com/TheAlgorithms/Python/blob/master/scheduling/shortest_job_first_algorithm.py)
* [Round Robin](https://github.com/TheAlgorithms/Python/blob/master/scheduling/round_robin.py)
* [Shortest Job First](https://github.com/TheAlgorithms/Python/blob/master/scheduling/shortest_job_first.py)

## Searches
* [Binary Search](https://github.com/TheAlgorithms/Python/blob/master/searches/binary_search.py)
Expand Down
4 changes: 2 additions & 2 deletions scheduling/round_robin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def calculate_waiting_times(burst_times: List[int]) -> List[int]:
rem_burst_times = list(burst_times)
waiting_times = [0] * len(burst_times)
t = 0
while 1:
while True:
done = True
for i, burst_time in enumerate(burst_times):
if rem_burst_times[i] > 0:
Expand All @@ -33,7 +33,7 @@ def calculate_waiting_times(burst_times: List[int]) -> List[int]:
rem_burst_times[i] -= quantum
else:
t += rem_burst_times[i]
waiting_times[i] = t - burst_times[i]
waiting_times[i] = t - burst_time
rem_burst_times[i] = 0
if done is True:
return waiting_times
Expand Down
File renamed without changes.

0 comments on commit 2c98dce

Please sign in to comment.