forked from UNN/2026-rff_mp
забыл убрать кусок кода с тестом data_structures. Убрал
This commit is contained in:
parent
54ab958f19
commit
232585fa83
|
|
@ -1,10 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Wed Apr 29 22:00:16 2026
|
||||
|
||||
@author: ddima
|
||||
"""
|
||||
|
||||
#--------------------------------------Связный список--------------------------
|
||||
def ll_insert(head, name, phone):
|
||||
# 1. если список пуст → новый элемент становится head
|
||||
|
|
@ -208,84 +201,3 @@ def bst_list_all(root):
|
|||
inorder(root)
|
||||
return result
|
||||
|
||||
|
||||
|
||||
print('--- LINKED LIST TEST ---')
|
||||
|
||||
head = None
|
||||
head = ll_insert(head, 'Иван', '111')
|
||||
head = ll_insert(head, 'Анна', '222')
|
||||
head = ll_insert(head, 'Петя', '333')
|
||||
head = ll_insert(head, 'Петя', '999')
|
||||
|
||||
print(ll_find(head, 'Петя')) # 999
|
||||
print(ll_list_all(head)) # [('Анна', ...), ('Иван', ...), ('Петя', ...)]
|
||||
|
||||
head = ll_delete(head, 'Иван')
|
||||
print(ll_find(head, 'Иван')) # None
|
||||
print(ll_list_all(head))
|
||||
|
||||
|
||||
print('--- HASH TABLE TEST ---')
|
||||
|
||||
buckets = [None] * 5
|
||||
|
||||
buckets = ht_insert(buckets, 'Иван', '111')
|
||||
buckets = ht_insert(buckets, 'Анна', '222')
|
||||
buckets = ht_insert(buckets, 'Петя', '333')
|
||||
buckets = ht_insert(buckets, 'Петя', '999')
|
||||
|
||||
print(ht_find(buckets, 'Петя')) # 999
|
||||
print(ht_list_all(buckets))
|
||||
|
||||
buckets = ht_delete(buckets, 'Петя')
|
||||
print(ht_find(buckets, 'Петя')) # None
|
||||
print(ht_list_all(buckets))
|
||||
|
||||
|
||||
print('--- BST TEST ---')
|
||||
|
||||
root = None
|
||||
|
||||
root = bst_insert(root, 'Иван', '111')
|
||||
root = bst_insert(root, 'Анна', '222')
|
||||
root = bst_insert(root, 'Петя', '333')
|
||||
root = bst_insert(root, 'Борис', '444')
|
||||
root = bst_insert(root, 'Олег', '555')
|
||||
root = bst_insert(root, 'Яна', '666')
|
||||
|
||||
print(bst_find(root, 'Олег')) # 555
|
||||
print(bst_list_all(root))
|
||||
|
||||
root = bst_insert(root, 'Олег', '000')
|
||||
print(bst_find(root, 'Олег')) # 000
|
||||
|
||||
root = bst_delete(root, 'Иван')
|
||||
print(bst_find(root, 'Иван')) # None
|
||||
print(bst_list_all(root))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Thu Apr 30 16:38:21 2026
|
||||
|
||||
@author: ddima
|
||||
"""
|
||||
|
||||
import data_structures as st
|
||||
import time
|
||||
import random
|
||||
|
|
@ -245,43 +238,3 @@ with open("results.csv", "w", newline="", encoding="utf-8") as f:
|
|||
|
||||
print("Результаты сохранены в results.csv")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user