跳至主要內容

二叉搜索树的最近公共祖先

微信公众号:储凡Less than 1 minute

二叉搜索树的最近公共祖先

题目链接

题目描述

刷题思路

代码实现

function TreeNode(x) {
  this.val = x
  this.left = null
  this.right = null
}
/**
 *
 * @param root TreeNode类
 * @param p int整型
 * @param q int整型
 * @return int整型
 */
function lowestCommonAncestor(root, p, q) {
}

一些建议