答案 0 :(得分:2)
绿色。您需要考虑算法步骤。查看the wikipedia page是否有插入步骤。关键部分是在考虑下一次插入之前,通过将中间值向上移动一级来分割4个节点(具有3个值)。
1. Insert 3 into blank. Result: 3 (a 2-node)
2. Insert 7. Result: 3 - 7 (a 3-node)
3. Insert 4. Result: 3 - 4 - 7 (a 4-node)
5. Insert 9. There is already a 4-node, so this must be split.
The split will be to move 4 up a level, and 3 and 7 are now child nodes of 4
(like your green diagram). 9 is then added next to the 7.