📜  门|门CS 2008 |第 41 题

📅  最后修改于: 2021-09-24 06:14:27             🧑  作者: Mango

4 阶 B 树是通过 10 次连续插入从头开始构建的。可能发生的最大节点分裂操作数是多少?
(一) 3
(乙) 4
(三) 5
(四) 6答案: (C)
解释:

Insertion of 3 keys
10 20 30

Insertion of 4th key (1st split)
     30
   /   \
10*20   40


Insertion of 5th key no split 
To maximize splits, let us insert a value in a node that has
key in access. Let us insert 5
      30
   /     \
5*10*20   40


Insertion of 6th key (2nd Split)
To maximize splits, let us insert a value in a node that has
key in access. Let us insert 6
      8*30
   /   |   \
5    10*20   40 


Insertion of 7th key
To maximize splits, let us insert a value in a node that has
key in access. Let us insert 15
        8*30
   /     |    \
5    10*15*20   40 



Insertion of 8th key (3rd Split)
To maximize splits, let us insert a value in a node that has
key in access. Let us insert 12
      8*12*30
   /   /   \  \
 5   10 15*20  40 


Insertion of 9th key 
To maximize splits, let us insert a value in a node that has
key in access. Let us insert 17
      8*12*30
   /  /   \   \
5  10 15*17*20 40 

Insertion of 10th key (4th and 5th Splits)
To maximize splits, let us insert a value in a node that has
key in access. Let us insert 13
          12
       /      \
      8       15*30
   /   \     /  |  \  
  5    10  13 17*20   40 

这个问题的测验