Skip to content

Trees-1 completed#1721

Open
sujaygijre wants to merge 3 commits intosuper30admin:masterfrom
sujaygijre:master
Open

Trees-1 completed#1721
sujaygijre wants to merge 3 commits intosuper30admin:masterfrom
sujaygijre:master

Conversation

@sujaygijre
Copy link
Copy Markdown

No description provided.

@super30admin
Copy link
Copy Markdown
Owner

Your solution for Validate BST is correct and efficient. You have implemented the recursive approach with min and max bounds correctly. The code is clean and easy to understand. Well done!

However, note that you included an unrelated solution (constructBTFromPreandInorder.cpp) in the same submission. For future reference, make sure to only submit the code relevant to the problem you are solving. This helps in avoiding confusion and ensures that the evaluator focuses on the correct solution.

For the Validate BST solution, you might consider adding a comment to explain the parameters of the helper function (min and max) to make it even clearer. For example:
// min: the minimum value the current node must be greater than (if not null)
// max: the maximum value the current node must be less than (if not null)

But this is optional as the code is already readable.

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