We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00f7847 commit 52891a4Copy full SHA for 52891a4
1 file changed
data_structures/binary_tree/red_black_tree.py
@@ -353,8 +353,9 @@ def check_color_properties(self) -> bool:
353
if not self.check_coloring():
354
return False
355
# Property 5
356
- if self.black_height() is not None:
+ return self.black_height() is not None
357
358
+
359
def check_coloring(self) -> bool:
360
"""Check if the tree satisfies Red-Black property 4."""
361
if self.color == 1 and 1 in (color(self.left), color(self.right)):
0 commit comments