Skip to content

Commit c7c6efe

Browse files
committed
imrpoved del_node func(4)
1 parent f4c5800 commit c7c6efe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

data_structures/binary_tree/avl_tree.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import math
1212
import random
13-
from typing import Any
13+
from typing import Any, Optional
1414

1515

1616
class MyQueue:
@@ -208,7 +208,7 @@ def get_min_value_node(node: MyNode) -> MyNode:
208208
return current
209209

210210

211-
def del_node(root: MyNode, data: Any) -> MyNode | None:
211+
def del_node(root: Optional[MyNode], data: Any) -> Optional[MyNode]:
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)