101 lines
1.4 KiB
Python
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() |