We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 969bae8 commit 271b617Copy full SHA for 271b617
solutions/235.Lowest_Common_Ancestor_of_a_Binary_Search_Tree/readme.md
@@ -0,0 +1,15 @@
1
+## 235. Lowest Common Ancestor of a Binary Search Tree (Easy)
2
+
3
+### **链接**:
4
+题目:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
5
+代码(github):https://github.com/illuz/leetcode
6
7
+### **题意**:
8
9
+求一个搜索二叉树的 LCA(最近公共祖先)。
10
11
+### **分析**:
12
13
+可以利用二叉树的性质做,只要从根节点向下找,如果 `leftval <= sub_root.val <= rightval`,那 sub_root 就是他们的 LCA。
14
+可以用递归做,也可以迭代做。
15
0 commit comments