有关Splay Tree的一点感想
来源:互联网 发布:淘宝账户登陆不上去 编辑:程序博客网 时间:2024/05/21 13:57
Splay Tree是一种有趣的Binary Search Tree。Wikipedia说它的缺点为:
Perhaps the most significant disadvantage of splay trees is that the height of a splay tree can be linear. For example, this will be the case after accessing all n elements in non-decreasing order. Since the height of a tree corresponds to the worst-case access time, this means that the actual cost of an operation can be slow. However the amortized access cost of this worst case is logarithmic, O(log n). Also, the expected access cost can be reduced to O(log n) by using a randomized variant[2].
A splay tree can be worse than a static tree by at most a constant factor.
Splay trees can change even when they are accessed in a 'read-only' manner (i.e. by find operations). This complicates the use of such splay trees in a multi-threaded environment. Specifically, extra management is needed if multiple threads are allowed to perform find operations concurrently.
碰巧发现Raymond Chen曾经也写过一点评论:The cost of trying too hard: Splay trees,提到了上述的一些缺点。
结合以前的工作,联想到了一下几点:
1. B+树为了加速顺序访问而提供了叶子节点之间的链接。
2. 系统中用户看到的只读访问有时确实不是完全彻底的“只读”:
a) 系统可能会调整内存结构中的信息,例如Cache相关的元信息。
b) 系统可能会调整外存结构中的信息,例如文件的Access时间。
c) 系统可能会记录事务日志。
3. 一旦需要考虑并发和事务,事情就会变得有点复杂。
- 有关Splay Tree的一点感想
- 有关substr的一点感想
- 有关Microsoft和sun的一点感想
- 有关虚拟机使用的一点感想
- 有关the serializable class的一点感想
- Splay tree的splay操作
- 游戏软件的一点感想
- 找工作的一点感想
- 我的一点感想
- 一点并行的感想。
- 软件的一点感想
- 自己的一点感想
- Linux的一点感想
- 管理的一点感想
- 开发的一点感想
- 最近的一点感想
- 最近的一点感想
- 关于“扑”先生有关BLOG中低素质程序员的一点感想
- 联想天逸F41M无线网卡搜索不到无线信号
- Linux学习笔记1
- oracle汇总
- 在PHP中使用Mysqli操作数据库
- You don't have permission to access /~whpc on this server.
- 有关Splay Tree的一点感想
- Ubuntu软件包管理概述
- Xcode使用教程详细讲解
- Android学习笔记之Gallery
- 【最大流+dinic+二分】北大 poj 2455 Secret Milking Machine
- SSIS - Sequence Container 任务执行
- NYOJ 27 水池数目
- Bill的挑战(set)
- VMware(网络连接-linux 的ip配置-主从机间共享文件夹)--转载