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 a65574b commit c161feeCopy full SHA for c161fee
data_structures/binary_tree/red_black_tree.py
@@ -1,7 +1,6 @@
1
from __future__ import annotations
2
3
from collections.abc import Iterator
4
-from pprint import pformat
5
6
7
class RedBlackTree:
@@ -652,6 +651,7 @@ def postorder_traverse(self) -> Iterator[int | None]:
652
651
653
def __repr__(self) -> str:
654
"""Return a string representation of the tree."""
+ from pprint import pformat
655
if self.left is None and self.right is None:
656
return f"'{self.label} {(self.color and 'red') or 'blk'}'"
657
return pformat(
0 commit comments