can anyone plz help me with this problems 1 to 4? TIA this Problems are from the book “ Foundations of Algorithm” by Richard E Neapolitan . 5th edition .

EXERCISES Sections 4.1 1. Show that the greedy approach always finds an optimal solution for the Change problem when the coin EXERCISES Sections 4.1 1. Show that the greedy approach always finds an optimal solution for the Change problem when the coins are in the denominations D, D’, D,.. , D for some integers i > 0 and D> 0. 2. Use Prim’s algorithm (Algorithm 4.1) to find a minimum spanning tree for the following graph. Show the actions step by step. 13 45 10 28 29 3. Consider the following array: 4 9039 73 sc 70 73 71 79 77 60 77 0 80 73 40 (a) Starting with vertex v trace through Prim’s algorithm to find a minimum spanning tree for the graph represented by the array shown here. (b) Show the set of edges that comprise the minimum spanning tree. (c) What is the cost of the minimum spanning tree? 4. Draw a graph that has more than one minimum spanning tree. 5. Implement Prim’s algorithm (Algorithm 4.1) on your system, and study its performance using different graphs. 6. Modify Prim’s algorithm (Algorithm 4.1) to check if an undirected, weighted graph is connected. Analyze your algorithm and show the results using order notation 7. Use Kruskal’s algorithm (Algorithm 4.2) to find a minimum spanning tree for the graph in Exercise 2. Show the actions step by step. 8. Implement Kruskal’s algorithm (Algorithm 4.2) on your system, and study its performance using different graphs. 9. Do you think it is possible fora minimum spanning tree to have a cycle? Justify your answer 10. Assume that in a network of computers any two computers can be linked. Given a cost estimate for each possible link, should Algorithm 4.1 (Prim’s lli Alab



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *