《剑指Offer》刷题笔记——面试题68 II. 二叉树的最近公共祖先
难度:简单 一、题目描述: 二、解题分析: # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def lowestCommonAncestor(self, root: TreeNode, p: TreeNode, q: TreeNode) -> TreeNode: #
下载地址
用户评论