[英]B+ tree deletion
So I have this B+ tree:所以我有这个 B+ 树:
I have to delete 49 here.我必须在这里删除 49。 How do I go about it?
我该怎么做 go 呢?
Will it be like this:会不会是这样:
Or like this?还是像这样? :
:
Hence, we end up with root node (32)--->(32,40,48) on the right sub-tree of the root.因此,我们最终在根的右子树上得到根节点 (32)--->(32,40,48)。
In-depth explanation:深入解释:
There are 3 cases for deleting a key.删除密钥有 3 种情况。 After deleting a key for node,
删除节点的密钥后,
If node still contains more than floor((n+1)/2) keys:如果节点仍然包含多于 floor((n+1)/2) 个键:
If node contains less than floor((n+1)/2) keys:如果节点包含少于 floor((n+1)/2) 个键:
** For cases 2 and 3, always remember to update parent nodes after borrowing or merging. ** 对于情况 2 和 3,请务必记住在借用或合并后更新父节点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.