mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 18:49:26 +08:00
Pyupgrade to Python 3.9 (#4718)
* Pyupgrade to Python 3.9 * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -3,11 +3,12 @@ Round Robin is a scheduling algorithm.
|
||||
In Round Robin each process is assigned a fixed time slot in a cyclic way.
|
||||
https://en.wikipedia.org/wiki/Round-robin_scheduling
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from statistics import mean
|
||||
from typing import List
|
||||
|
||||
|
||||
def calculate_waiting_times(burst_times: List[int]) -> List[int]:
|
||||
def calculate_waiting_times(burst_times: list[int]) -> list[int]:
|
||||
"""
|
||||
Calculate the waiting times of a list of processes that have a specified duration.
|
||||
|
||||
@ -40,8 +41,8 @@ def calculate_waiting_times(burst_times: List[int]) -> List[int]:
|
||||
|
||||
|
||||
def calculate_turn_around_times(
|
||||
burst_times: List[int], waiting_times: List[int]
|
||||
) -> List[int]:
|
||||
burst_times: list[int], waiting_times: list[int]
|
||||
) -> list[int]:
|
||||
"""
|
||||
>>> calculate_turn_around_times([1, 2, 3, 4], [0, 1, 3])
|
||||
[1, 3, 6]
|
||||
|
Reference in New Issue
Block a user