We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c666db3 commit 13e4d3eCopy full SHA for 13e4d3e
data_structures/binary_tree/avl_tree.py
@@ -221,6 +221,10 @@ def del_node(root: MyNode, data: Any) -> MyNode | None:
221
else:
222
root.set_right(del_node(right_child, data))
223
224
+ # Re-fetch left_child and right_child references
225
+ left_child = root.get_left()
226
+ right_child = root.get_right()
227
+
228
if get_height(right_child) - get_height(left_child) == 2:
229
assert right_child is not None
230
if get_height(right_child.get_right()) > get_height(right_child.get_left()):
0 commit comments