From 55d2c2af795e6e5b6f4e73f5d814b2a71e11c4d0 Mon Sep 17 00:00:00 2001 From: OOC Date: Mon, 6 Aug 2018 10:26:19 +0800 Subject: [PATCH] Changes for question 07. --- 07_ConstructBinaryTree/ConstructBinaryTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/07_ConstructBinaryTree/ConstructBinaryTree.cpp b/07_ConstructBinaryTree/ConstructBinaryTree.cpp index f0da28a..7cb82dc 100644 --- a/07_ConstructBinaryTree/ConstructBinaryTree.cpp +++ b/07_ConstructBinaryTree/ConstructBinaryTree.cpp @@ -55,7 +55,7 @@ BinaryTreeNode* ConstructCore // 在中序遍历中找到根结点的值 int* rootInorder = startInorder; - while(rootInorder <= endInorder && *rootInorder != rootValue) + while(rootInorder < endInorder && *rootInorder != rootValue) ++ rootInorder; if(rootInorder == endInorder && *rootInorder != rootValue)