简体   繁体   English

如何在B +树中插入?

[英]How to insert in B+ Tree?

I have the following set 1,2,3,4,6,8,12,15 我有以下设置1,2,3,4,6,8,12,15

I'm trying to insert these numbers in ascending order to an empty tree that has m=3 number of pointers. 我试图将这些数字按升序插入到具有m=3指针数的空树中。

I tried many tools but I'm getting different results not sure which one is correct. 我尝试了许多工具,但是得到的结果不同,不确定哪个是正确的。

This is from cs.usfca.edu 这是来自cs.usfca.edu 在此处输入图片说明

And this one is from goneill.co.nz 这是来自godill.co.nz

在此处输入图片说明

Why I'm getting different results ? 为什么我得到不同的结果?

Both are valid B+ trees (of order 3) for the set 1,2,3,4,6,8,12,15 . 对于集合1,2,3,4,6,8,12,15它们都是有效的B +树(第3阶)。 The solution from cs.usfca.edu is what one would expect if the set is entered as ordered (ie, from 1 onwards) with the branching going left if "less than" and right if "greater than or equal". 来自cs.usfca.edu的解决方案是,如果按顺序输入集(即从1开始),如果“小于”则分支向左,如果“大于或等于”则分支向右 ,那将会是什么。 It is unclear to me with what order of insertion goneill.co.nz gets to its result (and I don't have Java installed, so I can't run the script). 对我来说,不清楚插入的顺序是怎么产生的信息gotill.co.nz (而且我没有安装Java,所以我无法运行脚本)。 However he/she gives a detailed explanation as to the procedure followed there. 但是,他/她对此处遵循的步骤进行了详细说明

For an explanation of how to insert/delete in a B+ tree, there is a descent set of slides here . 有关如何插入解释/删除B +树,有一个血统组幻灯片的位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM