mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-05-22 00:43:22 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
6cd0cd31fe
commit
7654b0b9ed
@ -228,7 +228,7 @@ def del_node(root: MyNode | None, data: Any) -> MyNode | None:
|
||||
elif root.get_right() is None:
|
||||
return root.get_left()
|
||||
right_child = root.get_right()
|
||||
assert right_child is not None
|
||||
assert right_child is not None
|
||||
temp = get_min_value_node(right_child)
|
||||
root.set_data(temp.get_data())
|
||||
root.set_right(del_node(root.get_right(), temp.get_data()))
|
||||
@ -257,6 +257,7 @@ def del_node(root: MyNode | None, data: Any) -> MyNode | None:
|
||||
|
||||
return root
|
||||
|
||||
|
||||
class AVLtree:
|
||||
"""
|
||||
An AVL tree doctest
|
||||
@ -361,4 +362,4 @@ if __name__ == "__main__":
|
||||
random.shuffle(lst)
|
||||
for i in lst:
|
||||
t.del_node(i)
|
||||
print(str(t))
|
||||
print(str(t))
|
||||
|
Loading…
x
Reference in New Issue
Block a user