forked from UNN/2026-rff_mp
[13] Final. All is complete
This commit is contained in:
parent
83e323fff6
commit
41004bcb8a
BIN
ShapovalovKA/docs/1st_task_analysis.docx
Normal file
BIN
ShapovalovKA/docs/1st_task_analysis.docx
Normal file
Binary file not shown.
BIN
ShapovalovKA/docs/2nd_task_analysis.docx
Normal file
BIN
ShapovalovKA/docs/2nd_task_analysis.docx
Normal file
Binary file not shown.
48
ShapovalovKA/docs/data/1Task/res.py
Normal file
48
ShapovalovKA/docs/data/1Task/res.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import csv
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
array_arr = []
|
||||
array_list = []
|
||||
array_hash = []
|
||||
array_bin = []
|
||||
|
||||
with open('results.csv', 'r', encoding='utf-8-sig') as file:
|
||||
reader = csv.reader(file, delimiter=';')
|
||||
next(reader) # пропускаем заголовок
|
||||
|
||||
values = []
|
||||
for row in reader:
|
||||
values.append(float(row[3]))
|
||||
|
||||
array_arr = values[0:4]
|
||||
array_list = values[4:8]
|
||||
array_hash = values[8:12]
|
||||
array_bin = values[12:16]
|
||||
|
||||
print(f"array_arr : {array_arr}")
|
||||
print(f"array_list: {array_list}")
|
||||
print(f"array_hash: {array_hash}")
|
||||
print(f"array_bin : {array_bin}")
|
||||
|
||||
l = [1, 2, 3, 4]
|
||||
|
||||
#визуализация без дерева
|
||||
plt.plot(l, array_arr, label = 'Array', c='black')
|
||||
plt.plot(l, array_list, label = 'Linked list', c='blue')
|
||||
plt.plot(l, array_hash, label = 'Hash table', c='orange')
|
||||
plt.ylabel('array') #название по y
|
||||
plt.xlabel('l') #название по x
|
||||
plt.legend(loc='upper center', bbox_to_anchor=(0.5, 1.15), ncol = 3)
|
||||
plt.savefig('t1p1.png', dpi=300, bbox_inches='tight') #сохранение в файле
|
||||
plt.show()
|
||||
|
||||
#визуализация с деревом
|
||||
plt.plot(l, array_arr, label = 'Array', c='black')
|
||||
plt.plot(l, array_list, label = 'Linked list', c='blue')
|
||||
plt.plot(l, array_hash, label = 'Hash table', c='orange')
|
||||
plt.plot(l, array_bin, label = 'Binary tree', c='red')
|
||||
plt.ylabel('array') #название по y
|
||||
plt.xlabel('l') #название по x
|
||||
plt.legend(loc='upper center', bbox_to_anchor=(0.5, 1.15), ncol = 4)
|
||||
plt.savefig('t1p2.png', dpi=300, bbox_inches='tight') #сохранение в файле
|
||||
plt.show()
|
||||
9
ShapovalovKA/docs/data/1Task/results.csv
Normal file
9
ShapovalovKA/docs/data/1Task/results.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Структура;Режим;Операция;Время (сек)
|
||||
Array;случайный;вставка (в начало);0.06431880006566644
|
||||
Array;отсортированный;вставка (в начало);0.06380272014066576
|
||||
Array;любой;поиск 110 записей;0.07721293987706304
|
||||
Array;любой;удаление 50 записей (среднее);0.0018548803813755513
|
||||
Linked list;случайный;вставка (в начало);0.01246960014104843
|
||||
Linked list;отсортированный;вставка (в начало);0.007890580128878355
|
||||
Linked list;любой;поиск 110 записей;0.23582311999052763
|
||||
Linked list;любой;удаление 50 записей (среднее);0.0023578427862375973
|
||||
|
Gitea Version: 1.22.0 |
