Generation of B-trees
Flyfish 2015-7-19
Start building a B-tree from an empty tree insert keywords one at a time
Rules:
All non-terminal nodes outside the root node have at least ? m / 2 ? Subtrees tree, so the number of keywords must be n the number of keywords
? m/2?-1 ? N.
According to A0,k1,a1,k2,a2,...,kn,an
That is, the number of pointers is one more than the number of keywords
Because each node in the tree has a maximum of M subtrees tree, the number of keywords in the node cannot exceed M-1
That is, the threshold value of the number of keywords ? m / 2 ? ? 1 ? N ? m ? 1
Each time you insert a keyword does not add a leaf node in the tree, because this is no longer a valid B-tree, but first in the lowest layer of a non-terminal node to add a keyword, if the node's number of keywords does not exceed m-1, the insertion is completed, or to produce a node "split"
Green: Number of keywords
Red: pointer
Blue: Keywords
Build a B-tree with a degree of 3 keywords from 1 to 7
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Generation of B-trees