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

Function plot_runtimes

divide_and_conquer/max_subarray.py:95–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93
94
95def plot_runtimes() -> None:
96 input_sizes = [10, 100, 1000, 10000, 50000, 100000, 200000, 300000, 400000, 500000]
97 runtimes = [time_max_subarray(input_size) for input_size in input_sizes]
98 print("No of Inputs\t\tTime Taken")
99 for input_size, runtime in zip(input_sizes, runtimes):
100 print(input_size, "\t\t", runtime)
101 plt.plot(input_sizes, runtimes)
102 plt.xlabel("Number of Inputs")
103 plt.ylabel("Time taken in seconds")
104 plt.show()
105
106
107if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

time_max_subarrayFunction · 0.85
plotMethod · 0.80
showMethod · 0.80

Tested by

no test coverage detected