Skip to content

Commit 52891a4

Browse files
authored
Update red_black_tree.py
1 parent 00f7847 commit 52891a4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

data_structures/binary_tree/red_black_tree.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,9 @@ def check_color_properties(self) -> bool:
353353
if not self.check_coloring():
354354
return False
355355
# Property 5
356-
if self.black_height() is not None:
356+
return self.black_height() is not None
357357

358+
358359
def check_coloring(self) -> bool:
359360
"""Check if the tree satisfies Red-Black property 4."""
360361
if self.color == 1 and 1 in (color(self.left), color(self.right)):

0 commit comments

Comments
 (0)