[0] initial commit

This commit is contained in:
Veronika Minina 2026-03-22 18:53:04 +03:00
parent b16d3da3e2
commit 5d94d3f44e
2 changed files with 21 additions and 0 deletions

1
MininaVD/docs/Laba1.doc Normal file
View File

@ -0,0 +1 @@
ECHO is on.

View File

@ -0,0 +1,20 @@
Linked List Phone Book:
def ll_insert(head, name, phone):
new_node = {'name': name, 'phone' : phone, 'next': None}
if head is None:
return new_node
if head['name'] == name:
head['phone'] = phone
return head
current = head
while current['next'] is not None:
if current['next']['name'] == name:
current['next']['phone'] = phone
return head
current = current['next']
current['next'] = new_node
return head