简体   繁体   中英

How to insert in B+ Tree?

I have the following set 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.

I tried many tools but I'm getting different results not sure which one is correct.

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

And this one is from goneill.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 . 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". 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). 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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