From b5ddddbcff21ac1699c29c59e16e0344d52a964a Mon Sep 17 00:00:00 2001 From: smirnovavyu Date: Fri, 4 Sep 2026 15:14:10 +0000 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C=20Sm?= =?UTF-8?q?irnovaVYu/docs/data/linkedlist.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SmirnovaVYu/docs/data/linkedlist.py | 50 ----------------------------- 1 file changed, 50 deletions(-) delete mode 100644 SmirnovaVYu/docs/data/linkedlist.py diff --git a/SmirnovaVYu/docs/data/linkedlist.py b/SmirnovaVYu/docs/data/linkedlist.py deleted file mode 100644 index 6489ff95..00000000 --- a/SmirnovaVYu/docs/data/linkedlist.py +++ /dev/null @@ -1,50 +0,0 @@ -def ll_insert(head, name, phone): #Oбновление записи в связном списке - if head is None: - return {'name': name, 'phone': phone, 'next': None} - current = head - while current is not None: - if current['name'] == name: - current['phone'] = phone - return head - current = current['next'] - new_node = {'name': name, 'phone': phone, 'next': None} - current = head - while current['next'] is not None: - current = current['next'] - current['next'] = new_node - return head - - -def ll_find(head, name): #Поиск телефона по имени - current = head - while current is not None: - if current['name'] == name: - return current['phone'] - current = current['next'] - return None - - -def ll_delete(head, name): #Удаление записи по имени - if head is None: - return None - - if head['name'] == name: - return head['next'] - - current = head - while current['next'] is not None: - if current['next']['name'] == name: - current['next'] = current['next']['next'] - return head - current = current['next'] - return head - - -def ll_list_all(head): #Сбор всех записей и сортировка по имени - records = [] - current = head - while current is not None: - records.append((current['name'], current['phone'])) - current = current['next'] - records.sort(key=lambda x: x[0]) - return records \ No newline at end of file