知识卡片

普通读书笔记卡 · 3633.a.8.c.1.a

删除下行可从兄弟借键

理解等级:高级

在最小度为 t 的 B 树中,目标孩子仅有合法下限 t−1 个键,而相邻兄弟至少有 t 个时,可让父节点一个分隔键下降到目标孩子,再把兄弟一个键提升到父节点;内部节点还需把与该键对应的孩子指针一同转移。

这样目标孩子下行前达到 t 键。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 第18章 B树 · 查看原书依据

      Case 3a: x.ci has only t − 1 keys but has an immediate sibling with at least t keys. Give x.ci an extra key by moving a key from x down into x.ci, moving a key from x.ci’s immediate left or right sibling up into x, and moving the appropriate child pointer from the sibling into x.ci.

    参考来源

    - 位置:《算法导论(第4版)》第18章《B树》(OEBPS/chapter018.xhtml,文本字符[30000,35000))。 - 结论依据:原文Case 3a描述通过父节点在兄弟与目标孩子之间转移键和指针。 - 原始内容:Case 3a : x . c i has only t − 1 keys but has an immediate sibling with at least t keys. Give x . c i an extra key by moving a key from x down into x . c i , moving a key from x . c i ’s immediate left or right sibling up into x , and moving the appropriate child pointer from the sibling into x . c i .