We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c05e9d7 commit 8e3bf36Copy full SHA for 8e3bf36
1 file changed
vicutils/printBin.py
@@ -1,11 +1,13 @@
1
from itertools import product
2
+from functools import total_ordering
3
4
# Default configuration constants
5
DEFAULT_UNIT_SIZE = 3
6
DEFAULT_VALUE_FILL_CHAR = " " # Character used to pad node values (e.g., "_5_")
7
DEFAULT_CONNECTOR_FILL_CHAR = "_" # Character used to fill horizontal gaps between node pairs
8
9
10
+@total_ordering
11
class BinaryNode:
12
"""
13
Represents a node in a binary tree.
@@ -64,6 +66,12 @@ def __str__(self):
64
66
65
67
def __repr__(self):
68
return str(self)
69
+
70
+ def __eq__(self, value):
71
+ return self.val == value
72
73
+ def __lt__(self, value):
74
+ return self.val < value
75
76
77
def center(val, unitSize=None, fillChar=None):
0 commit comments