diff --git a/lectures/20-trees/code/introduction/BinaryTree.java b/lectures/20-trees/code/introduction/BinaryTree.java index 366317961..56f15b31b 100644 --- a/lectures/20-trees/code/introduction/BinaryTree.java +++ b/lectures/20-trees/code/introduction/BinaryTree.java @@ -96,29 +96,29 @@ private void preOrder(Node node) { } public void inOrder() { - preOrder(root); + inOrder(root); } private void inOrder(Node node) { if (node == null) { return; } - preOrder(node.left); + inOrder(node.left); System.out.print(node.value + " "); - preOrder(node.right); + inOrder(node.right); } public void postOrder() { - preOrder(root); + postOrder(root); } private void postOrder(Node node) { if (node == null) { return; } - preOrder(node.left); - preOrder(node.right); + postOrder(node.left); + postOrder(node.right); System.out.print(node.value + " "); } -} \ No newline at end of file +}