Skip to content

Commit

Permalink
fixing delete_fixup() in red_black_tree (keon#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
bea0113 authored Oct 9, 2020
1 parent 476fb94 commit 7370b8d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions algorithms/tree/red_black_tree/red_black_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ def delete_fixup(self, node):
node.parent.color = 0
node_brother.right.color = 0
self.left_rotate(node.parent)
node = self.root
break
node = self.root
else:
node_brother = node.parent.left
if node_brother.color == 1:
Expand All @@ -264,8 +263,7 @@ def delete_fixup(self, node):
node.parent.color = 0
node_brother.left.color = 0
self.right_rotate(node.parent)
node = self.root
break
node = self.root
node.color = 0

def inorder(self):
Expand Down

0 comments on commit 7370b8d

Please sign in to comment.