Skip to content

Commit 705130f

Browse files
authored
Merge pull request #2 from jerryrwu/master
fixed conditional
2 parents 1da180f + d181cd4 commit 705130f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

data-structures/red-black-trees/red_black_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __fix_delete(self, x):
8888
self.right_rotate(x.parent)
8989
s = x.parent.left
9090

91-
if s.right.color == 0 and s.right.color == 0:
91+
if s.left.color == 0 and s.right.color == 0:
9292
# case 3.2
9393
s.color = 1
9494
x = x.parent
@@ -378,4 +378,4 @@ def pretty_print(self):
378378
bst.insert(40)
379379
bst.insert(80)
380380
bst.delete_node(25)
381-
bst.pretty_print()
381+
bst.pretty_print()

0 commit comments

Comments
 (0)