RBT VS. AVL
来源:互联网 发布:阿里云翼 编辑:程序博客网 时间:2024/06/08 03:05
搜索了很久RBT和AVL的差别,先粘贴整理一下在网络上查找到的有价值的信息:
“AVL trees are actually easier to implement than RB trees because there are fewer cases. And AVL trees require O(1) rotations on an insertion, whereas red-black trees require O(lg n).
In practice, the speed of AVL trees versus red-black trees will depend on the data that you're inserting. If your data is well distributed, so that an unbalanced binary tree would generally be acceptable (i.e. roughly in random order), but you want to handle bad cases anyway, then red-black trees will be faster because they do less unnecessary rebalancing of already acceptable data.On the other hand, if a pathological insertion order (e.g. increasing order of key) is common, then AVL trees will be faster, because the stricter balancing rule will reduce the tree's height.
Splay trees might be even faster than either RB or AVL trees,depending on your data access distribution. And if you can use a hash instead of a tree, then that'll be fastest of all. ”
关于选择:
1. RBT侧重局部调整,所以有益于对于insertion、deletion多的应用场景(或者与query三者比较平均的情况),在stl::map以及linux下广泛应用;
2. AVL侧重整体调整,对于每一个insertion和deletion操作会对路径上所有的结点进行调整,有益于query较多的场景。
- RBT VS. AVL
- 二叉树之BST、AVL和RBT
- rbt
- RBT
- RBT
- 红黑树(RBT)和平衡二叉树(AVL)
- 红黑树 VS AVL树
- AVL树 VS 红黑树
- 红黑树 vs AVL
- 红黑树 VS AVL树
- AVL 树 VS红黑树
- 红黑树 VS AVL树
- 动态查找树比较——BST、AVL、RBT、B、B+
- BST二叉排序树,AVL平衡二叉树,RBT红黑树,B-树,B+树,B*树
- 二叉查找树(BST) 自平衡二叉搜索树(RBT、AVL)
- BST二叉搜索树、AVL平衡二叉树、RBT红黑树、B-树、B+树、B*树
- 二叉查找树(BST) | 平衡二叉查找树(AVL) | 红黑树(RBT)
- BST二叉查找树、AVL平衡二叉树、RBT红黑树、B-/B+/B*树性能对比
- mips64非法地址访问(汇编实现结构体成员地址访问)
- Redis系列-初识redis、安装
- 几个android 属性
- 【Java】java生成xls(poi)(2)
- iOS简单实现视频音频的边下边播
- RBT VS. AVL
- POJ2823Sliding Window--单调队列
- linux系统自启动脚本整理
- cocos2d-x在IOS7下面文字显示异常的解决办法
- 基于STK的空间态势仿真系统研究
- 2013年下半年百度安徽招聘笔试题
- Eclipse将引用了第三方jar包的Java项目打包成jar文件的两种方法
- OCP-1Z0-053-V12.02-218题
- Action的Result类型