Categorygithub.com/szhou12/leetcode-goleetcode0098-Validate-Binary-Search-Tree
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.Valmin, max 的值来判断是否合法。不能只比较root.Valroot.Left.Val 或者 root.Right.Val, 这样是不够的!!!

Time complexity = O(height)

Resource

东哥带你刷二叉搜索树(基操篇)

代码随想录