一次删除 B-Tree

B-Tree deletion in a single pass

是否可以一次性从 B 树中删除一个元素?

维基百科说 "Do a single pass down the tree, but before entering (visiting) a node, restructure the tree so that once the key to be deleted is encountered, it can be deleted without triggering the need for any further restructuring" 但没有说明它是如何完成的。

Google 只给我删除元素的过程,必须重新构造树。

Cormen 对此也只字不提。

在称为 PO-B+ tree 的 B+ 树变体中是可能的。在这个 "preparatory operations B+ tree" 节点中的键的数量可能在 n-1 和 2n+1 之间,而不是通常的 B+-tree 中的 n 和 2n (引自论文).对于删除操作(在论文中称为 PO-delete )你只需合并(在论文中称为 "catenate" )所有可以合并的节点(根节点除外)(或从邻居那里拿一把钥匙),同时向树叶移动。对于 PO-insert 操作,您拆分了所有节点(包括根节点)。论文中给出了描述

只有在多线程环境中使用树时,这种抢占式重组才有意义,因为它减少了锁定,提高了并发性。如果一棵树仅被一个参与者访问,则不支付。