We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1da180f + d181cd4 commit 705130fCopy full SHA for 705130f
1 file changed
data-structures/red-black-trees/red_black_tree.py
@@ -88,7 +88,7 @@ def __fix_delete(self, x):
88
self.right_rotate(x.parent)
89
s = x.parent.left
90
91
- if s.right.color == 0 and s.right.color == 0:
+ if s.left.color == 0 and s.right.color == 0:
92
# case 3.2
93
s.color = 1
94
x = x.parent
@@ -378,4 +378,4 @@ def pretty_print(self):
378
bst.insert(40)
379
bst.insert(80)
380
bst.delete_node(25)
381
- bst.pretty_print()
+ bst.pretty_print()
0 commit comments