在插入时使用重新分配的 B 树
如果我将字母 A、G、I 和 Y 插入 4 阶 B 树(意味着每个节点中有 4 个指针和 3 个元素),我会得到以下 B 树。
G
/ \
A IY
如果使用插入时重新分配,看起来会有什么不同吗?插入时的重新分配如何进行?
If I insert the letters A, G, I, and Y into a B-tree of order 4 (meaning 4 pointers and 3 elements in each node), I get the following B-tree.
G
/ \
A IY
Would it look any different if redistribution on insertion were used? How does redistribution on insertion work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题有点循环。通常,数据结构中的重新分配是为了平衡目的。 B 树本质上是平衡的,因此问题将变成“在插入时重新分配的原因是什么?”在这种情况下,算法将取决于您想要实现的目标。
B树可以在删除时执行重新分配;这就是你的意思吗?或者,您有任何参考链接吗?
This question is kind of circular. Often, redistribution in data structures is done for balancing purposes. B-trees are balanced by their nature, so the question would become "what reason would you have for redistributing on insertion?" And in that case, the algorithm would depend on what you were trying to achieve.
B-trees can perform redistribution on deletion; is that what you meant? Or, do you have any reference links?