比较基础的写法 class Solution { public: int lowestCommonAncestor(TreeNode* root, int p, int q) { if(min(p, q)<root->val && root->val<max(p, q)) return root->val; else if(root->val<min(p, q)) return lowestCommonAncestor(root->right, p, q); else if(root->val>max(p, q)) r...