LeetCode75-700-Search-in-BST
🧠 Summary of Thoughts
A Binary Search Tree is an ordered Binary Tree.
Binary Tree (BT)、Binary Search Tree (BST)、Heap 的核心区别:
Do not utilize the properties of BST (Traverse the entire tree)
This method didn’t use the properties of BST, need to traverse the entire tree, which is slow.
Utilize the properties of BST
Compare the values ($val < root.val$, $val = root.val$, $val > root.val$).
✅ Code(Java)
- Do not utilize the properties of BST (Traverse the entire tree)
1 | |
- Utilize the properties of BST
1 | |
LeetCode75-700-Search-in-BST
https://powersixxx.github.io/leetcode-blog/2026/03/08/LeetCode75-700-Search-in-BST/