Skip to content

Changes for question 07. #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Changes for question 07. #24

wants to merge 1 commit into from

Conversation

OOCZC
Copy link

@OOCZC OOCZC commented Aug 6, 2018

while(rootInorder <= endInorder && *rootInorder != rootValue)
    ++ rootInorder;

if(rootInorder == endInorder && *rootInorder != rootValue)
    throw std::exception("Invalid input.");

rootInorder == endInorder && *rootInorder != rootValue时会继续++ rootInorder;,此时应该为无效输入,缺不能符合rootInorder == endInorder的判断条件。

则修改为:
while(rootInorder < endInorder && *rootInorder != rootValue)
++ rootInorder;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant