[1] Написана функция поиска
This commit is contained in:
parent
7c9a1f8b51
commit
88bcf8a761
|
|
@ -12,7 +12,7 @@ def create_linked_list(data: list[dict]) -> dict:
|
||||||
for value in data[1:]:
|
for value in data[1:]:
|
||||||
current['next'] = create_node(**value)
|
current['next'] = create_node(**value)
|
||||||
current = current['next']
|
current = current['next']
|
||||||
|
|
||||||
return base
|
return base
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -20,8 +20,15 @@ def ll_insert():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def ll_find():
|
def ll_find(head: dict, name: str) -> str | None:
|
||||||
pass
|
if head is None:
|
||||||
|
raise ValueError("Словарь пустой!")
|
||||||
|
|
||||||
|
current = head
|
||||||
|
while current['next'] is not None:
|
||||||
|
if current['name'] == name:
|
||||||
|
return current['name']
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def ll_delete():
|
def ll_delete():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user