Section 1-Graph traversal
|
topic |
Difficulty |
Accept |
1 |
[Example question] One-stroke drawing problem |
|
submit |
2 |
Snow shovel |
|
submit |
3 |
Riding a fence |
|
submit |
Section 2-Shortest Path
一、单源最短路
: The side right cannot be negative;
dijkstra (朴素版)
:O (n 2) O (n ^ 2)O ( n2)
dijkstra (堆优化)
:O (mlogn) O (mlogn)O ( m l o g n )
二、单源最短路
: The side weight can be positive or negative, but there can be no negative weight loop;
bellman_ford
: O ( n m ) O(nm) O(nm)
spfa
:General O (m) O(m)O ( m ) , the worstO (nm) O(nm)O(nm)
三、多源最短路
: The side weight can be positive or negative, but there can be no negative weight loop;
floyd
:O (n 3) O (n ^ 3)O ( n3)
Section 3-Connectivity of Graphs
Section 4-Consolidation
find函数
:
无优化
: Average O (logn) O(logn)O ( l o g n ) , the worstO (n) O(n)O ( n )
路径压缩
: Average O (α (n)) O(α(n))O ( α ( n ) ) , the worstO (logn) O(logn)O ( l o g n )
按秩合并
: Average O (logn) O(logn)O ( l o g n ) , the worstO (logn) O(logn)O ( l o g n )
路径压缩 + 按秩合并
: Average O (α (n)) O(α(n))O ( α ( n ) ), 最坏O (α (n)) O (α (n))O ( α ( n ) )
α
: Inverse Ackerman function, for the possible value n, α (n) α(n)α ( n ) are all less than 5;
Section 5-Minimum Spanning Tree
|
topic |
Difficulty |
Accept |
1 |
[Example 4.9] The construction of urban public transport network |
|
submit |
2 |
[Example 4.10] Optimal wiring problem |
|
submit |
3 |
[Example 4.11] The shortest network |
|
submit |
4 |
[Example 4.12] Family Tree |
|
submit |
5 |
local area network |
|
submit |
6 |
Busy city |
|
submit |
7 |
Liaison |
|
submit |
8 |
Connected grid |
|
submit |
Section 6-Topological Sorting and Critical Path
|
topic |
Difficulty |
Accept |
1 |
[Example 4.13] Bonus |
|
submit |
2 |
Annoying slideshow |
|
submit |
3 |
virus |
|
submit |