From 60b42ee51cbd3cdc5d34a746258429e560c0cd3a Mon Sep 17 00:00:00 2001 From: volkovva Date: Sat, 23 May 2026 14:47:03 +0300 Subject: [PATCH] =?UTF-8?q?=20=D0=B7=D0=B0=D0=BA=D0=BE=D0=BD=D1=87=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=81=D0=B2=D1=8F=D0=B7=D0=BD=D1=8B=D0=B9=20=D1=81?= =?UTF-8?q?=D0=BF=D0=B8=D1=81=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VolkovVA/cod.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/VolkovVA/cod.py b/VolkovVA/cod.py index 7495326..eb77941 100644 --- a/VolkovVA/cod.py +++ b/VolkovVA/cod.py @@ -18,3 +18,39 @@ def ll_insert(head, name, phone): new_node['next'] = head return new_node +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 + + +def ll_list_all(head): + record=[] + current=head + while current is not None: + record.append(current['name'], current['phone']) + current=current['next'] + record.sort(key=lambda x: x[0]) + return record + + + + + +