A Level Ancestory query LA($u$, $d$) asks for the the ancestor of the node $u$ at a depth $d$. We present a simple solution, which pre-processes the tree in $O(n)$ time with $O(n)$ extra space, and answers the queries in $O(\log\ {n})$ time. Though other optimal algorithms exist, this is a simple enough solution that could be taught and implemented easily.


翻译:水平传承查询 LA( $, $d$) 要求节点的祖先在深度为 $ $ 美元 。 我们提出了一个简单的解决方案, 将树用美元( n) 时间和美元( n) 额外空间进行预处理, 并用美元( log\ { } $) 时间回答询问。 尽管存在其他最佳算法, 但这是一个非常简单的解决方案, 可以轻松地教授和实施 。

0
下载
关闭预览

相关内容

一份简单《图神经网络》教程,28页ppt
专知会员服务
127+阅读 · 2020年8月2日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
2019年机器学习框架回顾
专知会员服务
36+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
94+阅读 · 2019年10月10日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
已删除
将门创投
9+阅读 · 2017年7月28日
Arxiv
0+阅读 · 2022年1月12日
Arxiv
0+阅读 · 2022年1月4日
Meta-Learning with Implicit Gradients
Arxiv
13+阅读 · 2019年9月10日
Learning to Importance Sample in Primary Sample Space
Arxiv
3+阅读 · 2018年2月24日
VIP会员
最新内容
人工智能赋能无人机:俄乌战争(万字长文)
专知会员服务
4+阅读 · 今天6:56
国外海军作战管理系统与作战训练系统
专知会员服务
2+阅读 · 今天4:16
美军条令《海军陆战队规划流程(2026版)》
专知会员服务
9+阅读 · 今天3:36
《压缩式分布式交互仿真标准》120页
专知会员服务
4+阅读 · 今天3:21
《电子战数据交换模型研究报告》
专知会员服务
6+阅读 · 今天3:13
《基于Transformer的异常舰船导航识别与跟踪》80页
《低数据领域军事目标检测模型研究》
专知会员服务
6+阅读 · 今天2:37
【CMU博士论文】物理世界的视觉感知与深度理解
专知会员服务
10+阅读 · 4月22日
伊朗战争停火期间美军关键弹药状况分析
专知会员服务
8+阅读 · 4月22日
电子战革命:塑造战场的十年突破(2015–2025)
相关资讯
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
已删除
将门创投
9+阅读 · 2017年7月28日
Top
微信扫码咨询专知VIP会员