B+树

首先从B-树谈起

B-树的定义

A B-tree of order m (the maximum number of children for each node) is a tree which satisfies the following properties:

   1. Every node has at most m children.

   2. Every node (except root and leaves) has at least ceil(m⁄2) children.

   3. The root has at least two children if it is not a leaf node.

   4. All leaves appear in the same level, and carry information.

   5. A non-leaf node with k children contains k–1 key

   6. Each leaf node (other than the root node if it is a leaf) must contain at least ceil(m / 2) - 1 keys

  7. Keys and subtrees are arranged in the fashion of search tree

210059_GwaE_81653.gif

根节点与普通节点关键字与分支的范围

210316_LLYQ_81653.gif

B-树的例子

210531_nPdR_81653.gif

B+tree

The B+ tree is a variant of the B-tree, all records are stored at the leaf level of the tree; only keys are stored in interior nodes.  B-tree can store both keys and records in its interior nodes; in this sense, the B+ tree is a specialization of the B-tree. 

A B+treeis a B-tree in which data records are in leaf nodes, and faster sequential access is possible

211449_cOkZ_81653.gif

严蔚敏的数据结构中对B+树的定义

213051_EKUc_81653.gif

213159_hjcj_81653.gif

213354_Ndtd_81653.gif


B+树的插入

143338_4qZk_81653.gif

143459_5vzF_81653.gif

B+树的删除

删除普通节点

144037_A53I_81653.gif

删除后节点数目少于m/2向下取整

144218_KNWZ_81653.gif

删除后节点数目少,且不能向相邻节点借节点

144606_RCr0_81653.gif

144720_qLqO_81653.gif



转载于:https://my.oschina.net/hnuweiwei/blog/287770

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值