知识卡片
Dijkstra数组版平方时间
若用数组存未确定顶点的估计,插入和降键为 O(1),但每次找最小值需扫描 O(V)。
V 次提取使总时间 O(V²+E)=O(V²),适合稠密图的简单实现。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第22章 单源最短路径 · 查看原书依据
A simple implementation takes advantage of the vertices being numbered 1 to |V|: simply store v.d in the vth entry of an array. Each INSERT and DECREASE-KEY operation takes O(1) time, and each EXTRACT-MIN
参考来源
- 位置:《算法导论(第4版)》第22章《单源最短路径》(OEBPS/chapter022.xhtml,文本字符[35000,40000))。
- 结论依据:原文逐项计算数组优先队列操作成本和总复杂度。
- 原始内容:A simple implementation takes advantage of the vertices being numbered 1 to | V |: simply store v.d in the v th entry of an array. Each I NSERT and D ECREASE -K EY operation takes O (1) time, and each E XTRACT -M IN