0

I’m having trouble understanding how to insert elements into a b*-tree, especially when it comes to the root node.

Lets say you have a b*-tree of order 9, and you were to insert the following items into the tree, 0, 1 , 2 ,5 ,7,9,10 and 12 I would think that you start off inserting into the root then by the time you insert 12 it would be full so it would overflow, therefore it would cause for the root to be split and have a root node which contains 7, a left child which contains 0, 1, 2, 5 and a right child that contains 9, 10 and 12. Am i correct in thinking so or is there another way of doing this.

PS: Please note I used b-tree as a tag because I could not use b*-tree Any help would be appreciated:)

1 Answers1

0

(r+1)/2 r=8 9/2=4,5 truncate it then you have 4. 0,1,2,5 your root must be 4th element.it means 5 and has left child 0-1-2 right child 7-9-10-12.I am not sure that I have udnerstood your question if you write your capacity order I may help you better

Burak Karasoy
  • 1,682
  • 2
  • 21
  • 33
  • in the formula above what is r? Also what do you mean by capacity order? –  Mar 22 '15 at 21:49
  • .http://upload.wikimedia.org/wikipedia/commons/3/37/Bplustree.png assume this tree on picture is a b# tree.If we add 8,an overflow occurs.4 5 5 6 7 8 there are elements we are gonna relocate.In this situation r=6. (6+1)/2=3 so new root is 5. – Burak Karasoy Mar 22 '15 at 22:48