Question: Problem 5 (20 points) Consider the directed acyclic graph shown. Use the following algorithm covered in class to determine a valid topological sorting of the

Problem 5 (20 points) Consider the directed acyclic graph shown. Use the following algorithm covered in class to determine a valid topological sorting of the vertices of the DAG 1 vertex[] topo_sort(graph G) 2 int n - number_of_vertices (G); 3 = new vertex ni; vertex order 3 vmin-find a "minimal" vertex in G; 6 order[i1vmin; 7 8 7 G = remove vmin from G; // SHOW GRAPH HERE 10 return order; 6 Show the graph and order variable each time line 8 is reached If working online, you may use the a graph editor such as as Graph Editor from CS Academy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
