File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
data_structures/binary_tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -335,13 +335,14 @@ def _remove_repair(self) -> None:
335335 self .parent .color = 0
336336 self .parent .sibling .color = 0
337337
338- def check_color_properties ( self ) -> bool :
338+
339339 def check_color_properties (self ) -> bool :
340340 """
341341 Verify that all Red-Black Tree properties are satisfied:
342- 1. Root node is black
343- 2. No two consecutive red nodes (red node cannot have red children)
344- 3. All paths from any node to its leaf descendants have the same number of black nodes
342+ # Root node is black
343+ # No two consecutive red nodes (red node cannot have red children)
344+ # All paths from any node to its leaf descendants have
345+ # the same number of black nodes
345346
346347 Returns:
347348 True if all properties are satisfied, False otherwise
@@ -373,7 +374,7 @@ def check_coloring(self) -> bool:
373374 return False
374375 return not (self .right and not self .right .check_coloring ())
375376
376- def black_height (self ) -> int | None :
377+ def black_height (self ) -> int | None :
377378 """
378379 Calculate the black height of the tree and verify consistency
379380 - Black height = number of black nodes from current node to any leaf
You can’t perform that action at this time.
0 commit comments