diff --git a/nikolaevda/task1/Zadanie1.py b/nikolaevda/task1/Zadanie1.py index cfa955b..cdb49d9 100644 --- a/nikolaevda/task1/Zadanie1.py +++ b/nikolaevda/task1/Zadanie1.py @@ -72,6 +72,13 @@ def ll_delete(head, name): return head +def ll_collect(head, result_list): + """собирает все данные из связного списка в result_list""" + current = head + while current is not None: + result_list.append((current['name'], current['phone'])) + current = current['next'] + def ll_list_all(head): @@ -161,3 +168,12 @@ def ht_list_all(buckets): # Сортируем пузырьком bubble_sort(full_data) return full_data + +Hash_table1 = hash_table(3) + +ht_insert(Hash_table1, 'Alena', '010') +ht_insert(Hash_table1, 'Helena', '111') +ht_insert(Hash_table1, 'Gena', '222') + + +print(ht_list_all(Hash_table1)) \ No newline at end of file