aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/binarytree.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/binarytree.py b/source/binarytree.py
index 428578ae..52e32db7 100644
--- a/source/binarytree.py
+++ b/source/binarytree.py
@@ -115,8 +115,8 @@ class OrderedBinaryTree(object):
pass
else:
result.append(root.data)
- self.in_order_traversal(root.left, result)
- self.in_order_traversal(root.right, result)
+ self.pre_order_traversal(root.left, result)
+ self.pre_order_traversal(root.right, result)
return result
def in_order_traversal(self, root, result=[]):
@@ -138,8 +138,8 @@ class OrderedBinaryTree(object):
if root == None:
pass
else:
- self.in_order_traversal(root.left, result)
- self.in_order_traversal(root.right, result)
+ self.post_order_traversal(root.left, result)
+ self.post_order_traversal(root.right, result)
result.append(root.data)
return result
bgstack15