Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ab084df

Browse files
committedOct 13, 2024·
improved del_node func(5)
1 parent 64822ac commit ab084df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎data_structures/binary_tree/avl_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def get_min_value_node(node: MyNode) -> MyNode:
208208
return current
209209

210210

211-
def del_node(root: Optional[MyNode], data: Any) -> Optional[MyNode]:
211+
def del_node(root: MyNode | None, data: Any) -> MyNode | None:
212212
if root is None:
213213
print("Nothing to delete")
214214
return None
@@ -358,4 +358,4 @@ def _test() -> None:
358358
random.shuffle(lst)
359359
for i in lst:
360360
t.del_node(i)
361-
print(str(t))
361+
print(str(t))

0 commit comments

Comments
 (0)
Please sign in to comment.