This preview shows page 1. Sign up to view the full content.
Unformatted text preview: i do if mark[w] = 0 then begin mark[w]=1; count=count-1 e n d if count = 1 then print(YES) else print(NO) 8. Sort the below graph topologically. Illustrate all major steps. A solution at the end 9. In the graph from Question 4 replace arrows by lines, i.e. translate it into a graph which is indirected. Assume ordering as in 4.b. a. Find a minimum-cost spanning tree by Prims algorithm. b. Find a minimum-cost spanning tree by Kruskals algorithm. c. Find a depth-first spanning tree starting at a. d. Find a breadth-first spanning tree starting at a. Give all steps. Solutions at the end...
View Full Document
This note was uploaded on 12/10/2009 for the course CAS 2c03 taught by Professor Janicki during the Spring '03 term at McMaster University.
- Spring '03