知识卡片
d叉堆以分支数换树高
d 叉堆把二叉堆的每个内部节点扩为最多 d 个孩子,仍保留堆序与紧凑层序存储。
当 2≤d≤n 时,由习题 6-2 可推得树高 Θ(log_d n):增键上浮每层比较常数次,为 O(log_d n);提取最大值下沉每层须扫描至多 d 个孩子,为 O(d log_d n)。
d 的取舍还受操作比例影响。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第6章 堆排序 · 查看原书依据
A d-ary heap is like a binary heap, but (with one possible exception) nonleaf nodes have d children instead of two children.
参考来源
- 位置:《算法导论(第4版)》第 6 章 6.5 节、Problems 与 Chapter notes(`OEBPS/chapter006.xhtml`,文本字符 [30000, 35000);图 6.5)。
- 结论依据:问题 6-2 仅给 d 叉堆定义并要求分析操作复杂度;按每层至多 d 个子节点、在 2≤d≤n 时由 n 个节点高度 Θ(log_d n) 推得下沉 O(d log_d n),上浮 O(log_d n),题设另设映射维护 O(1)。
- 原始内容:A d-ary heap is like a binary heap, but (with one possible exception) nonleaf nodes have d children instead of two children.