【解题报告】【lintcode88】Lowest Common Ancestor

题意

给出一颗二叉树中的两个节点,寻找它们的最小公共祖先

解法

分为两个部分
1.寻找给出节点的路径
2.比较这两个路径,寻找最小公共祖先

代码

u3coding
A software developer

Leave a Comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.