[0] initial commit
This commit is contained in:
parent
b16d3da3e2
commit
5d94d3f44e
1
MininaVD/docs/Laba1.doc
Normal file
1
MininaVD/docs/Laba1.doc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
ECHO is on.
|
||||||
20
MininaVD/docs/data/Laba1dop.doc
Normal file
20
MininaVD/docs/data/Laba1dop.doc
Normal 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user