# B+树 习题解

B+树是一种n叉树，它将所有数据存在一个level中。B+ 树的特点是能够保持数据稳定有序，其插入与修改拥有较稳定的对数时间复杂度。因此B+树被应用于数据库和操作系统的文件系统中。
B+树的理解没有红黑树这么复杂，本文将首先简要介绍B+树，然后分析B+树的先关题目。本文重点是最后一部分。

# 介绍

A B+ tree of order M is a tree with the following structural properties:
(1) The root is either a leaf or has between 2 and M children.
(2) All nonleaf nodes (except the root) have between M/2$\lceil M/2 \rceil$ and M children.
(3) All leaves are at the same depth.
Assume each nonroot leaf also has between M/2$\lceil M/2 \rceil$ and M children.

1. 每个存储数据的叶节点，其中的数据数量在M/2$\lceil M/2 \rceil$ 与 M之间（闭区间）。若超出这个区间，则进行调整。
2. 从空树开始时，数据首先存放在根节点中，当根节点的数据大于M时再进行调整。
3. 根的子节点数最小为2， 而其他非根节点的子节点数最小为 M/2$\lceil M/2 \rceil$

# 相关题目

Insert 3, 1, 4, 5, 9, 2, 6, 8, 7, 0 into an initially empty 2-3 tree (with splitting). Which one of the following statements is FALSE? (2分)
A. 7 and 8 are in the same node
B. the parent of the node containing 5 has 3 children
C. the first key stored in the root is 6
D. there are 5 leaf nodes

After deleting 9 from the 2-3 tree given in the figure, which one of the following statements is FALSE? (2分)

A. the root is full
B. the second key stored in the root is 6
C. 6 and 8 are in the same node
D. 6 and 5 are in the same node

Which of the following statements concerning a B+ tree of order M is TRUE? (2分)
A. the root always has between 2 and M children
B. not all leaves are at the same depth
C. leaves and nonleaf nodes have some key values in common
D. all nonleaf nodes have between ⌈M/2⌉ and M children

A. 当只有root一个节点时，root没有孩子。故错。
B. 这违反了定义“所有叶节点位于同一深度”。
C. 正确。
D. 除了根节点外的非叶结点有 ⌈M/2⌉ 与 M 之间的子节点。

• 本文已收录于以下专栏：

举报原因： 您举报文章：B+树 习题解 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)