B 树和 2-3-4 树之间的区别
B 树和 2-3-4 树有什么区别?
另外,你如何找到每个的最大和最小高度?
What is the difference between B-Trees and 2-3-4 Trees?
Also, how would you find the maximum and minimum height of each?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
...Wikipedia 的链接和引用:
A
2-3-4
是一个B-树
。它被称为 2-3-4 树,因为非叶、非根节点的子节点数量为 2,3 或 4。
如果是 6,则可以称为 3-4-5-6 树,或简称 3-6 树。
由于子节点的最小数量是最大子节点数量的一半,因此通常可以跳过前者并讨论 m 阶的 B 树。
B 树的阶数定义为节点可以拥有的子节点的最大数量。
在 2-3-4 树中,正如我们所见,最大值为 4。
最坏和最好情况的高度由 B 树的一般公式。
最佳情况:logmn。 (所有节点已满)
最坏情况:logm/2n。 (所有节点都是半空的),
其中
“B 树可以有任意数字的顺序” - 是的,但是对于 B 树的特定子类,您可以在以下位置修复该数字:进步。这就像谈论一般蝴蝶与谈论帝王蝶。 B 树是一类数据结构,就像蝴蝶是一类昆虫一样。 帝王蝶是蝴蝶的子类,就像2-3-4树是B的子类一样-树木。
...a link to Wikipedia and a quote:
A
2-3-4
is aB-tree
.It is called 2-3-4 tree because the number of children for a non-leaf, non-root node is 2,3 or 4.
Had it been 6, it could have been called a 3-4-5-6 tree, or 3-6 tree for short.
Since the minimum number of children is half of the maximum, one can just usually skip the former and talk about a B-tree of order m.
The order of a B-tree is defined as the maximum number of children a node can have.
In a 2-3-4 tree, as we have seen, the maximum is 4.
It's worst and best-case height is given by the general formula for B-trees.
Best case: logmn. (all nodes are full)
Worst case: logm/2n. (all nodes are half-empty)
where
"B tree can have an order of any number " - yes, but for a particular subclass of B-trees, you fix that number in advance. It's like talking about butterflies in general vs talking about the Monarch butterfly. B-trees are a class of data structures, just like butterflies are a class of insects. Monarch butterflies are a subclass of butterflies, just like 2-3-4 trees are a subclass of B-trees.
b-tree 存在的主要区别是插入时所需的节点分裂次数少于 2-4 树。在 2-4 树中,我们有时会发现一个称为级联分裂的术语,但在 b 树中不存在级联分裂。
the main difference why b-tree comes into existence is the number of node splitting required in time of insertion is less than 2-4 tree. In 2-4 tree we found sometimes a term called cascade splitting but in b-tree there is no cascade splitting present.