MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / time_max_subarray

Function time_max_subarray

divide_and_conquer/max_subarray.py:87–92  ·  view source on GitHub ↗
(input_size: int)

Source from the content-addressed store, hash-verified

85
86
87def time_max_subarray(input_size: int) -> float:
88 arr = [randint(1, input_size) for _ in range(input_size)]
89 start = time.time()
90 max_subarray(arr, 0, input_size - 1)
91 end = time.time()
92 return end - start
93
94
95def plot_runtimes() -> None:

Callers 1

plot_runtimesFunction · 0.85

Calls 1

max_subarrayFunction · 0.85

Tested by

no test coverage detected