package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev
# README
98. Validate Binary Search Tree
Solution idea
Recursion
注意传入 min
, max
值,通过比较root.Val
与 min
, max
的值来判断是否合法。不能只比较root.Val
与 root.Left.Val
或者 root.Right.Val
, 这样是不够的!!!
Time complexity = O(height)