We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a476b38 commit b6d8373Copy full SHA for b6d8373
algorithms/binary_tree.py
@@ -129,7 +129,7 @@ def compare_trees(self, node):
129
else:
130
res = self.right.compare_trees(node.right)
131
return res
132
-
+
133
def print_tree(self):
134
"""
135
Print tree content inorder
@@ -147,7 +147,7 @@ def tree_data(self):
147
# we use a stack to traverse the tree in a non-recursive way
148
stack = []
149
node = self
150
- while stack or node:
+ while stack or node:
151
if node:
152
stack.append(node)
153
node = node.left
@@ -167,4 +167,5 @@ def children_count(self):
167
cnt += 1
168
if self.right:
169
170
- return cnt
+ return cnt
171
0 commit comments