学堂在线_数据结构下_作业_R&B-Tree

A node in a red-balck tree could be红黑树节点的颜色有?

红,黑。

What's unique about red-black trees compared to AVL trees? 红黑树相比于AVL树的特点是:

The topology changes no more than O(1) after each insertion/deletion
每次插入/删除后拓扑结构的变化不超过O(1)

判断:所有AVL树可以染成红黑树,所有红黑树都是AVL树。

X

The root of a red-black tree is 红黑树的根节点的颜色是 黑。

The external nodes are 外部节点的颜色是 黑。

A red-black tree is equivalent to a B-tree of order __

红黑树等价于____阶B树:

4

In a red-black tree of size n, the black height wouldn't exceed __

规模为n的红黑树,黑高度不超过:

O(lgn)

The height wouldn't exceed __ 高度不超过: O(lgn)

What is a 'double red' in a red-black tree? 在红黑树中,何为双红缺陷:

both a parent and its child are red 相邻的两个父子节点都为红色

How does the topology changes when fixing a double red and the uncle node u is red.
当叔父节点u为红色时,修正双红缺陷导致的红黑树拓扑结构的变化为:

no change 没有变化

Splay trees have large worst-case time complexity for a single operation, however, they reduce the number of I/O by exploiting hierachical storage
伸展树虽然单次操作的最坏时间复杂度比较大,但是可以利用存储器的层次结构降低I/O的次数

X

Splay trees are difficult to implement 伸展树相较于AVL树的缺点是它实现起来较为复杂

X

Splay trees have larger amortized complexity than AVL trees for insertion
伸展树插入操作的分摊复杂度比AVL树大

X

Splay trees have larger worst-case time complexity than AVL trees for searching
伸展树单次查找操作的最坏时间复杂度比AVL树大

This is a splay tree. What is the result after accessing node v and performing a two-layer splay?
上图是伸展树,其中节点v刚被访问过,双层伸展后的结果是:

----------

This is a splay tree. What's the result after inserting a node 1 and performing a two-layer splay? 在以上伸展树中插入节点1并经过双层伸展后的结果是

---------------------------

Which statement regarding (2, 4)-trees is incorrect? 关于(2, 4)-树,下列命题不正确 的是:

Each node has exactly 3 keys except for the root 除了根节点外,每个内部节点都恰好包含3个关键码

An overflow occurs after inserting node 52 into a (3,6)-tree, what's the result after splitting?
上图是(3,6)-树中刚插入节点52后的情形,可以看出发生了上溢,分裂后的结果为:

-------------

An underflow occurs after removing a node from a (3,6)-tree, what's the result after the adjustment?
上图是(3,6)-树中刚删除某节点后的情形,可以看出发生了下溢,调整后的结果为:

--------------------

Which statement regarding red-black trees is wrong? 以下关于红黑树的说法,错误的是:

A red-black tree of size n has a balck height of O(lgn), but the height is not necessarily O(lgn)
含n个节点的红黑树,其黑高度为O(lgn),但是总的高度却未必是O(lgn)

What's the result after fixing the double red? 对上图中红黑树的节点x进行双红修正的结果是:

--------------------

Wich property could be violated after removing a node in a red-black tree using the algorithm for BST node removal?
在红黑树中直接按照常规的BST删除节点算法删除一个节点,关于红黑树结构的四条性质是否有可能被破坏?

1、the root is balck 树根必为黑色 could be violated 有可能会被破坏 

2、the external nodes are black 外部节点必均为黑色 won't be violated 不会被破坏

3、the children of a red node are black 红色节点的孩子必为黑 could be violated 有可能会被破坏

4、there are equal number of black nodes in each path from a external node to the root
从根到外部节点的不同路径途中黑色节点数目相等 could be violated 有可能会被破坏 

We know many BBSTs up until now. 至此,我们接触了以下几种平衡二叉搜索树

  1. AVL trees AVL树

  2. Splay trees 伸展树

  3. B-trees B-树

  4. Red-black trees 红黑树

  5. kd-trres (see PA3 and the lecture note) kd-树(见PA3以及讲义)

Please choose a BBST for each of thw following scenarios
针对下列应用的特点,请你选取最合适的平衡二叉搜索树

accessing massive amount of data (which cannot fit into the memory)
对大规模的数据(不能全部存放于内存中)的存取 —— B-trees B-树

Easy implementation and O(lgn) complexity 需要易于实现,而且各接口的分摊复杂度为O(lgn) —— Splay trees 伸展树

Problems related to geometry 处理和几何有关的问题 —— kd-trres  kd-树

Implementing a version control system 扩充后可支持对历史版本的访问 —— Red-black trees 红黑树

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值