Skip to content

Commit

Permalink
Fix removing the root node in binary_search_tree.py removes the whole…
Browse files Browse the repository at this point in the history
… tree (#8752)

* fix issue #8715

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Frank-1998 and pre-commit-ci[bot] authored Jun 18, 2023
1 parent e6f89a6 commit b0f8710
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data_structures/binary_tree/binary_search_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __reassign_nodes(self, node: Node, new_children: Node | None) -> None:
else:
node.parent.left = new_children
else:
self.root = None
self.root = new_children

def is_right(self, node: Node) -> bool:
if node.parent and node.parent.right:
Expand Down

0 comments on commit b0f8710

Please sign in to comment.