Skip to content

Validate Binary Search Tree #83

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

Closed
wants to merge 2 commits into from
Closed

Conversation

lxieyang
Copy link
Contributor

The previous version will cause wrong answer. The current version fixed that issue. Comparator used.

Note that the original implementation will cause wrong answer. The new version I updated is correct.
加了分析
@soulmachine
Copy link
Owner

Hi, my code is much shorter than yours, and it can also pass all test cases. Why do we need to change the code?

@lxieyang
Copy link
Contributor Author

Hi. I double checked the original code. It seems that it's not passing one of the long test cases. Would you check again? Correct me if I'm wrong plz.

@soulmachine
Copy link
Owner

I submitted my code a few seconds ago, and it accepted.

@lxieyang
Copy link
Contributor Author

I’ve attached the resulting webpage. Is there a problem with the inconsistency?

On Feb 25, 2016, at 2:08 AM, Frank Dai [email protected] wrote:

I submitted my code a few seconds ago, and it accepted.


Reply to this email directly or view it on GitHub #83 (comment).

@soulmachine
Copy link
Owner

I'm sorry, my code in my computer is newer than Github, the code on Github has a problem, I just modified one line and pushed to Github, it should work now

@lxieyang
Copy link
Contributor Author

Would you also compile the tex file so that the pdf is up-to-date. If there’s any chance, could you also include my version to the tex? I thought it was more clear in terms of thought flow: get the inorder traversal values and then check if valid.

On Feb 25, 2016, at 2:23 AM, Frank Dai [email protected] wrote:

I'm sorry, my code in my computer is newer than Github, the code on Github has a problem, I just modified one line and pushed to Github, it should work now


Reply to this email directly or view it on GitHub #83 (comment).

@soulmachine
Copy link
Owner

I will update the PDF, but in this case, your code is also recursive but much verbose than mine, there is no value to adopt your code, thanks

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.

2 participants