Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
二叉树
考虑到我们允许一个节点是它自己的后代,那么上面二叉树中 5 和 4 的最低共同祖先是什么。不会是3吗?如果不是,那会是什么,为什么?
由于我们允许一个节点成为它自己的后代,因此 LCA 将为 5。