2011.02.24 CLRS Chapter18 B-Tree

本文详细介绍了B树的概念及其关键属性,包括节点结构、键值分布、平衡特性等,并提供了搜索、创建及插入操作的具体算法。

 

Definition of B-Tree:

B-tree T is a rooted tree (whose root is root[T]) having the following properties:

  1. Every node x has the following fields:

    1. n[x], the number of keys currently stored in node x,

    2. the n[x] keys themselves, stored in nondecreasing order, so that key1[x key2[x ···  keyn[x][x],

    3. leaf [x], a boolean value that is TRUE if x is a leaf and FALSE if x is an internal node.

  2. Each internal node x also contains n[x]+ 1 pointers c1[x], c2[x], ..., cn[x]+1[x] to its children. Leaf nodes have no children, so their cifields are undefined.

  3. The keys keyi[x] separate the ranges of keys stored in each subtree: if ki is any key stored in the subtree with root ci [x], then

    k1  key1[x k2  key2[x···  keyn[x][x kn[x]+1.

  4. All leaves have the same depth, which is the tree's height h.

  5. There are lower and upper bounds on the number of keys a node can contain. These bounds can be expressed in terms of a fixed integer t  2 called the minimum degree of the B-tree:

    1. Every node other than the root must have at least t - 1 keys. Every internal node other than the root thus has at least t children. If the tree is nonempty, the root must have at least one key.

    2. Every node can contain at most 2t - 1 keys. Therefore, an internal node can have at most 2t children. We say that a node is fullif it contains exactly 2t - 1 keys.[1]

The simplest B-tree occurs when t = 2. Every internal node then has either 2, 3, or 4 children, and we have a 2-3-4 tree. In practice, however, much larger values of t are typically used.

 

 
other notes:
B-tree are balanced search trees designed to work well on magnetic disks or other direct-access secondary storage devices.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值