From e977158c8b6ecf3adf1e0159b870892b97a52264 Mon Sep 17 00:00:00 2001 From: lvzhenbang Date: Wed, 17 Jul 2019 08:47:36 +0800 Subject: [PATCH] fix fake code error of traversal --- src/data-structures/tree/binary-search-tree/README.md | 6 +++--- src/data-structures/tree/binary-search-tree/README.pt-BR.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data-structures/tree/binary-search-tree/README.md b/src/data-structures/tree/binary-search-tree/README.md index 140e2d24..f3e448a9 100644 --- a/src/data-structures/tree/binary-search-tree/README.md +++ b/src/data-structures/tree/binary-search-tree/README.md @@ -223,7 +223,7 @@ end findMax inorder(root) Pre: root is the root node of the BST Post: the nodes in the BST have been visited in inorder - if root = ø + if root != ø inorder(root.left) yield root.value inorder(root.right) @@ -237,7 +237,7 @@ end inorder preorder(root) Pre: root is the root node of the BST Post: the nodes in the BST have been visited in preorder - if root = ø + if root != ø yield root.value preorder(root.left) preorder(root.right) @@ -251,7 +251,7 @@ end preorder postorder(root) Pre: root is the root node of the BST Post: the nodes in the BST have been visited in postorder - if root = ø + if root != ø postorder(root.left) postorder(root.right) yield root.value diff --git a/src/data-structures/tree/binary-search-tree/README.pt-BR.md b/src/data-structures/tree/binary-search-tree/README.pt-BR.md index 4565538a..80f6f886 100644 --- a/src/data-structures/tree/binary-search-tree/README.pt-BR.md +++ b/src/data-structures/tree/binary-search-tree/README.pt-BR.md @@ -222,7 +222,7 @@ end findMax inorder(root) Pre: root is the root node of the BST Post: the nodes in the BST have been visited in inorder - if root = ø + if root != ø inorder(root.left) yield root.value inorder(root.right) @@ -236,7 +236,7 @@ end inorder preorder(root) Pre: root is the root node of the BST Post: the nodes in the BST have been visited in preorder - if root = ø + if root != ø yield root.value preorder(root.left) preorder(root.right) @@ -250,7 +250,7 @@ end preorder postorder(root) Pre: root is the root node of the BST Post: the nodes in the BST have been visited in postorder - if root = ø + if root != ø postorder(root.left) postorder(root.right) yield root.value