知识卡片
B树删除按树高计IO
设 B 树含 n 个键、最小度为 t、高度为 h=O(log_t n)。删除虽分借键、合并和替换等情形,每层只做常数次块读写,因此磁盘访问数为 O(h);若每节点线性处理 O(t) 个键,CPU 成本为 O(th)=O(t log_t n)。
这是给定伪代码模型下的复杂度界。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第18章 B树 · 查看原书依据
Although this procedure seems complicated, it involves only O(h) disk operations for a B-tree of height h, since only O(1) calls to DISK-READ and DISK-WRITE are made between recursive invocations of the procedure. The CPU time required is O(th) = O(t logtn).
参考来源
- 位置:《算法导论(第4版)》第18章《B树》(OEBPS/chapter018.xhtml,文本字符[35000,40000))。
- 结论依据:原文在各删除分支后分别给出I/O和CPU成本。
- 原始内容:Although this procedure seems complicated, it involves only O ( h ) disk operations for a B-tree of height h , since only O (1) calls to D ISK -R EAD and D ISK -W RITE are made between recursive invocations of the procedure. The CPU time required is O ( th ) = O ( t log t n ).