设为首页 加入收藏

TOP

求树中两个节点的最低公共祖先(三)
2015-07-24 05:57:30 来源: 作者: 【 】 浏览:14
Tags:两个节点 最低 公共 祖先
or2( A, B, D); System.out.println("The lowest common ancestor of 5 and 6 is " +res1.value); System.out.println("The lowest common ancestor of 4 and 5 is " +res2.value); System.out.println("The lowest common ancestor of 2 and 4 is " +res3.value); } 结果:

The lowest common ancestor of 5 and6 is 1

The lowest common ancestor of 4 and5 is 2

The lowest common ancestor of 2 and 4 is 1


首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇HDU 1698 Just a Hook 线段树解法 下一篇POJ 3613 Cow Relays (floyd + ..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: