C#C
C#3y ago
morry329#

❔ Comprehension questions for the LC solution

So I take a look at this solution right now: https://leetcode.com/problems/validate-binary-search-tree/solutions/3327674/simple-c-code/?envType=study-plan&id=level-1&languageTags=csharp

There are a couple of lines I did not understand fully.

  1. the check l[i]>=l[i+1] in the bool method. What could it mean?
  2. In the helper method (Inorder) the root.val is added after the list looks at the left node of the root node and before it looks at the right node of the root node. Why is it like that?
Could anyone kindly explain those to me?
LeetCode
View VikasSinghThakur07's solution of Validate Binary Search Tree on LeetCode, the world's largest programming community.
Was this page helpful?