LCA
shishiness
这个作者很懒,什么都没留下…
展开
-
pat 甲级 树 A1143 Lowest Common Ancestor (30分)给出二叉搜索树的先序 找LCA
1143 Lowest Common Ancestor (30分) The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. A binary search tree (BST) is recursively defined as a binary tree which has the following propert原创 2020-08-22 18:11:23 · 96 阅读 · 0 评论 -
pat 甲级 树 A1151 LCA in a Binary Tree (30分)
1151 LCA in a Binary Tree (30分) The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. Given any two nodes in a binary tree, you are supposed to find their LCA. Input Specification: Eac原创 2020-08-22 18:11:11 · 65 阅读 · 0 评论