Final Assignment
Data Structures and Algorithms
UU-COM-2012-MW
, 1 a. MST by Prim’s algorithm.
Mst set = {f,h,g,e,d,c,a,b}
b e 2 g
1
2
d 3
a 1
3 c f
1 h
b. Minimum-cost Spanning tree by Kruskal’s algorithm
e
b
2 g
2 d 1
ba 2
a
1
3
f h
c 1
, 1 c. DFS tree starting at a. DFS tree starting at d.
a
2
3
b
c 2
d
dv 2
1
2 b
2
e c e 2
1 1 a
f f
2 2
g
g
3
3
h
h
Data Structures and Algorithms
UU-COM-2012-MW
, 1 a. MST by Prim’s algorithm.
Mst set = {f,h,g,e,d,c,a,b}
b e 2 g
1
2
d 3
a 1
3 c f
1 h
b. Minimum-cost Spanning tree by Kruskal’s algorithm
e
b
2 g
2 d 1
ba 2
a
1
3
f h
c 1
, 1 c. DFS tree starting at a. DFS tree starting at d.
a
2
3
b
c 2
d
dv 2
1
2 b
2
e c e 2
1 1 a
f f
2 2
g
g
3
3
h
h