最佳答案
绿色。您需要考虑算法步骤。查看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.
关于algorithm - 插入2-3-4树时如何拆分节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42295308/