2026-rff_mp/romanovpv/task 1/docs/data/graphs.py
2026-05-12 20:36:42 +03:00

101 lines
1.4 KiB
Python

import matplotlib.pyplot as plt
plt.figure(figsize=(6, 5))
plt.bar(
["Sorted", "Random"],
[8.083650, 5.302733]
)
plt.title("LinkedList — Insert")
plt.ylabel("Time (sec)")
plt.show()
plt.figure(figsize=(6, 5))
plt.bar(
["Sorted", "Random"],
[0.071586, 0.079588]
)
plt.title("LinkedList — Search")
plt.ylabel("Time (sec)")
plt.show()
plt.figure(figsize=(6, 5))
plt.bar(
["Sorted", "Random"],
[0.042504, 0.052027]
)
plt.title("LinkedList — Delete")
plt.ylabel("Time (sec)")
plt.show()
plt.figure(figsize=(6, 5))
plt.bar(
["Sorted", "Random"],
[0.101125, 0.121933]
)
plt.title("HashTable — Insert")
plt.ylabel("Time (sec)")
plt.show()
plt.figure(figsize=(6, 5))
plt.bar(
["Sorted", "Random"],
[0.000974, 0.000976]
)
plt.title("HashTable — Search")
plt.ylabel("Time (sec)")
plt.show()
plt.figure(figsize=(6, 5))
plt.bar(
["Sorted", "Random"],
[0.000567, 0.000591]
)
plt.title("HashTable — Delete")
plt.ylabel("Time (sec)")
plt.show()
plt.figure(figsize=(6, 5))
plt.bar(
["Sorted", "Random"],
[14.745275, 0.205333]
)
plt.title("BST — Insert")
plt.ylabel("Time (sec)")
plt.show()
plt.figure(figsize=(6, 5))
plt.bar(
["Sorted", "Random"],
[0.149163, 0.000375]
)
plt.title("BST — Search")
plt.ylabel("Time (sec)")
plt.show()
plt.figure(figsize=(6, 5))
plt.bar(
["Sorted", "Random"],
[0.302392, 0.002267]
)
plt.title("BST — Delete")
plt.ylabel("Time (sec)")
plt.show()