diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-03-23 20:54:26 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-03-23 20:54:26 +0100 |
commit | 545e2001a5181d5e983fb878480fce23993d1df0 (patch) | |
tree | 53bececa272867401032b3e5e2bfad912a0677a0 /source | |
parent | Updated description. (diff) | |
download | newspipe-545e2001a5181d5e983fb878480fce23993d1df0.tar.gz newspipe-545e2001a5181d5e983fb878480fce23993d1df0.tar.bz2 newspipe-545e2001a5181d5e983fb878480fce23993d1df0.zip |
Bugfix: wrong function call in the recursive tree walking function.
Diffstat (limited to 'source')
-rw-r--r-- | source/binarytree.py | 8 |
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 |