van Emde Boas Trees(vEB树)(Introduction to Algorithms, 算法导论,CLRS)学习笔记
van Emde Boas Trees
1. Predecessor search/ordered sets
- predecessor: return the nearest left neighbor
- successor: return the nearest right neighbor
2.Naive: O(∣U∣)O(|U|)O(∣U∣) space
- predecessor/successor: if x∈Sx\in Sx∈S then it’s O(1)O(1)O(1);
- insert: worst case: O∣U∣O|U|O∣U∣; compare with all elements; lucky case smaller than the min or bigger than the max.
3. Twolevel: O(∣U∣)O(|U|)O(∣U∣) space
- predecessor/successor: worst case: loop over the cluster of one summary, and the length of the cluster is half of the length of the original number, which is w/2w/2w/2. And since for each position in the binary there could be 1/01/01/0, then there would be 2[w/2]2^{[w/2]}2[w/2] different elements in one cluster. Thus, the time: O(∣U∣)O(\sqrt{|U|})O(∣U∣).
- insert: loop over the summary and loop over one of the whole cluster.
4. Recursive: O(∣U∣)O(|U|)O(∣U∣) space
- Stop: when the length of the elements is 111;
- Theorem: the recursion depth of the universe U=[2w]U=[2^w]U=[2w] is [log2w]=O(loglog∣U∣)[\log_2w]=O(loglog|U|)[log2w]=O(loglog∣U∣);
- Proof (intuitive): each recursion in binary we half the length of elements, and the recursion would stop when the length is 111, then we can know there are [log2w][\log_2w][log2w] recursions in O(loglog∣U∣)O(\log\log |U|)O(loglog∣U∣)
Time in operations
- member: go through the recursion depth to check;
- predecessor/successor: go through the recursion depth;
- insert/delete: operation on both summary and cluster, then it would be double the depth of the recursion depth.
5. vEB: worst case O(loglog∣U∣)O(\log\log|U|)O(loglog∣U∣) time, O(∣U∣)O(|U|)O(∣U∣) space
How to improve the time:
Idea: Exclude min(SSS) and/or max(SSS) from the set of keys stored in summary and clusters.
- line 10 to line 13: enter the next depth
6. RS-vEB: expected O(loglog|U|) time, O(nloglog|U|)
Use a hash table to store clusters.
Time: Since the depth of the veb tree is O(loglog∣U∣)O(\log\log|U|)O(loglog∣U∣), and in hash table the time for updates is O(1)O(1)O(1);
Space: each time we insert a new element, the space cost would be O(loglog∣U∣)O(\log\log|U|)O(loglog∣U∣) in worst case, thus the total space would be the number of elements times the depth.
7. R2SR^2SR2S-vEB: expected O(loglog|U|) time, O(n) space
van Emde Boas Trees(vEB树)(Introduction to Algorithms, 算法导论,CLRS)学习笔记相关推荐
- 【adoo】Van Emde Boas trees
各种姿势补充中--转自http://www.roading.org/algorithm/introductiontoalgorithm/Van_Emde_Boas_trees.html van Emd ...
- Van Emde Boas Trees
## 介绍 ## van Emde Boas trees 支持所有优先级优先级队列的操作,并且巧妙的是它对于SEARCH, INSERT,DELETE,MINIMUM,MAXMUN,SUCCESSOR ...
- Hashing哈希函数(Introduction to Algorithms, 算法导论,CLRS)学习笔记
Hashing Hashing fundamentals Application: Unordered sets Hash table with chaining Practical universa ...
- Linear Programming线性规划(Introduction to Algorithms, 算法导论,CLRS)学习笔记
Linear Programming 1. Fundamentals objective function and constraints: min/max3x1+24x2+13x3+9x4...s. ...
- 《算法导论3rd第二十章》van Emde Boas树
前言 前面介绍的二叉堆,红黑树以及斐波那契堆,其重要的操作都要O(lgn).当特定条件下,能否够规避Ω(lglgn)下界的限制?在本章中,我们将看到:van Emde Boas树支持优先队列操作及一些 ...
- Van emde boas树Java实现
简介 VEB树的基础理论在算法导论第三版第20章有详细介绍,这里不再赘述. VEB树的优势 VEB树支持插入.删除.搜索.最大值.最小值.前驱.后继等操作. 这些操作的时间复杂度都是O(lglgu), ...
- 算法导论读书笔记(20)van Emde Boas树
第五部分 高级数据结构 第20章 van Emde Boas树 van Emde Boas树支持优先队列操作以及一些其他操作,每个操作最坏情况运行时间为O(lglgn).而这种数据结构限制关键字必须为 ...
- van Emde Boas 树 数据结构说解
van Emde Boas 树的定义 直观上看,vEB 树保存了一个有序的集合,并支持以 O(lglgn) 的时间复杂度在 vEB 树上进行最小最大值查询.单值存在性查询.单值前驱后继查询.单值插入维 ...
- 算法导论-van Emde Boas树
van Emde Boas树 van Emde Boas树中文名不知道,所以暂且叫它v树吧.v树是一种数据结构,和二叉树.红黑树类似.一种数据结构被创建出来,肯定有其特别的优点,v树的优点就是实现数据 ...
最新文章
- python中__str__与__repr__
- iOS:多个单元格的删除(方法二):
- 【翻译】关于vertical-align所有你需要知道的
- 如何写 go 代码 (How to Write Go Code 翻译)
- Java程序中fix time_Java Position.setFixTime方法代码示例
- c语言sleep函数上限多久解除,关于sleep函数的问题,
- oracle分区键使用大于小于会失效吗_大规模使用 Apache Kafka 的20个最佳实践
- 大数据平台容量评估_如何评估组织的数据平台
- VLD在VS2019中的使用以及应用程序无法正常启动(0xc0150002)
- android ndk standalone,Android NDK Standalone Toolchain(中文翻译)
- 大学计算机实践教程raptor,大学计算机实践教程.docx
- 【巨杉数据库SequoiaDB】限额开放!巨杉数据库中级工程师认证计划正式开启!
- mds is damaged
- VSCode下载及安装
- Microsoft 365独家安全解决方案
- 大数据是让人幸福的科学
- html中文字不自动换行 white-space style
- Windows10与Kali Linux之间通过XFTP来共享文件
- mini2440 sd卡支持
- Payload 实现分离免杀