[1] Написана функция поиска

This commit is contained in:
SerKin0 2026-03-06 09:55:45 +03:00
parent 7c9a1f8b51
commit 88bcf8a761

View File

@ -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():