Generation of B-trees

Source: Internet
Author: User

Generation of B-trees
Flyfish 2015-7-19
Start building a B-tree from an empty tree insert keywords one at a time


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.