MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / calculate_turn_around_times

Function calculate_turn_around_times

scheduling/round_robin.py:44–53  ·  view source on GitHub ↗

>>> calculate_turn_around_times([1, 2, 3, 4], [0, 1, 3]) [1, 3, 6] >>> calculate_turn_around_times([10, 3, 7], [10, 6, 11]) [20, 9, 18]

(
    burst_times: list[int], waiting_times: list[int]
)

Source from the content-addressed store, hash-verified

42
43
44def calculate_turn_around_times(
45 burst_times: list[int], waiting_times: list[int]
46) -> list[int]:
47 """
48 >>> calculate_turn_around_times([1, 2, 3, 4], [0, 1, 3])
49 [1, 3, 6]
50 >>> calculate_turn_around_times([10, 3, 7], [10, 6, 11])
51 [20, 9, 18]
52 """
53 return [burst + waiting for burst, waiting in zip(burst_times, waiting_times)]
54
55
56if __name__ == "__main__":

Callers 1

round_robin.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected