Question
Write the Prim’s algorithm to find the minimum cost spanning tree of a graph. Also, find the time complexity of Prim’s algorithm. Demonstrate the use of Kruskal’s algorithm and Prim’s algorithm to find the minimum cost spanning tree for the Graph given in Figure 1. Show all the steps.
Answer :
Word Count : 414
## a) Prim’s and Kruskal’s Algorithm for Minimum Spanning Tree ### **Prim’s Algorithm: Steps and Time Complexity** **Algorithm Steps**: 1. Start from any vertex (say, **A**), add it to the MST. 2. Repeatedly add the minimum weight edge that connects a vertex in the MST to a vertex outside the MST until all vertices are included. **Time Complexity**: - Using a simple array: $$O(V^2)$$ - With Min Heap (priority ____ _____ ______ ________ _______ __________ _____ _________ _________ _________ _________.
________ _________ _________ ________ ___ _____.
_____ ____ _________ ______ ______ __________ ________ ____ _______ ____ __________ _______.
_____ __________ _________ __________ __________ _____ __________ _________ _____.
_________ _________ _____ _______ _______.
___ ________ _____ _______ _______ _____.
_____ _____ ___ ___ _____ ____ ______ _____.
_________ ______ ______ ________ __________ ________ ________ _____.
________ _____ ____ ________ _____ ____ ________ ____ _____ __________.
______ __________ _________ ___ ______ _____ _____ ________ _________ __________ _______.
___ _____ _____ _____ ___ __________ ________ ____.
_______ _______ __________ __________ ___ _________ _____ _______ ______.
_____ ______ _______ ______ ___ _______ ___ ____ ________ _______ _________ ____.
_______ __________ __________ __________ ___ ________ ________ _____ _____ _____.
________ ____ _____ _______ _________ _________ _______.
________ _______ _____ __________ ______.
_____ ___ ____ ______ ____ ______.
______ ______ _________ _______ ______ ________ _____ __________ ___.
_______ _______ ____ ___ _______ _________ ___ _________ ________ ____ ________.
___ ________ ____ ______ ________ ____.
________ _____ _________ _______ _______ _______ ___ _________ _____ __________.
_________ ___ _________ ________ _______ ________ __________ __________ __________ ____ _____ _________.
_________ ___ __________ _____ ____ ________ ______ ___ _________ ________.
__________ ________ ________ _____ ______ ________ _____.
________ _____ ________ _________ _______ __________ _______ _____ _________.
________ ____ __________ ________ __________ ____ ____ ________.
____ __________ ___ _____ ____ ______ _________ ________ ________ ____ _________ _________.
____ _________ ___ __________ ___ _________ ____ ________ _____ _______ ________ ______.
____ _____ ____ _________ ______.
__________ ________ ___ _______ ____.
______ _____ ___ _______ _____ ________.
___ ________ ______ _________ _____.
______ ____ ___ _____ _______ _________ _____.
________ __________ __________ ___ ________ ___ ____ ____ ____ ______ _____.
________ _____ ___ ________ ____.
______ ___ _____ __________ ______ _____ _______ __________ ________ ____.
__________ _________ _________ _____ ______ _______.
_______ ____ _______ _______ ________.
__________ ________ _________ __________ ________ __________ ____.
_________ ____ ___ __________ ___ ___ __________ ____ __________ ____.
___ ___ ______ _________ _______ _________ _____ ______ __________.
_______ ____ _____ ______ _______.
Get Full Answer on WhatsApp
## a) Prim’s and Kruskal’s Algorithm for Minimum Spanning Tree ### **Prim’s Algorithm: Steps and Time Complexity** **Algorithm Steps**: 1. Start from any vertex (say, **A**), add it to the MST. 2. Repeatedly add the minimum weight edge that connects a vertex in the MST to a vertex outside the MST until all vertices are included. **Time Complexity**: - Using a simple array: $$O(V^2)$$ - With Min Heap (priority ____ _____ ______ ________ _______ __________ _____ _________ _________ _________ _________.
________ _________ _________ ________ ___ _____.
_____ ____ _________ ______ ______ __________ ________ ____ _______ ____ __________ _______.
_____ __________ _________ __________ __________ _____ __________ _________ _____.
_________ _________ _____ _______ _______.
___ ________ _____ _______ _______ _____.
_____ _____ ___ ___ _____ ____ ______ _____.
_________ ______ ______ ________ __________ ________ ________ _____.
________ _____ ____ ________ _____ ____ ________ ____ _____ __________.
______ __________ _________ ___ ______ _____ _____ ________ _________ __________ _______.
___ _____ _____ _____ ___ __________ ________ ____.
_______ _______ __________ __________ ___ _________ _____ _______ ______.
_____ ______ _______ ______ ___ _______ ___ ____ ________ _______ _________ ____.
_______ __________ __________ __________ ___ ________ ________ _____ _____ _____.
________ ____ _____ _______ _________ _________ _______.
________ _______ _____ __________ ______.
_____ ___ ____ ______ ____ ______.
______ ______ _________ _______ ______ ________ _____ __________ ___.
_______ _______ ____ ___ _______ _________ ___ _________ ________ ____ ________.
___ ________ ____ ______ ________ ____.
________ _____ _________ _______ _______ _______ ___ _________ _____ __________.
_________ ___ _________ ________ _______ ________ __________ __________ __________ ____ _____ _________.
_________ ___ __________ _____ ____ ________ ______ ___ _________ ________.
__________ ________ ________ _____ ______ ________ _____.
________ _____ ________ _________ _______ __________ _______ _____ _________.
________ ____ __________ ________ __________ ____ ____ ________.
____ __________ ___ _____ ____ ______ _________ ________ ________ ____ _________ _________.
____ _________ ___ __________ ___ _________ ____ ________ _____ _______ ________ ______.
____ _____ ____ _________ ______.
__________ ________ ___ _______ ____.
______ _____ ___ _______ _____ ________.
___ ________ ______ _________ _____.
______ ____ ___ _____ _______ _________ _____.
________ __________ __________ ___ ________ ___ ____ ____ ____ ______ _____.
________ _____ ___ ________ ____.
______ ___ _____ __________ ______ _____ _______ __________ ________ ____.
__________ _________ _________ _____ ______ _______.
_______ ____ _______ _______ ________.
__________ ________ _________ __________ ________ __________ ____.
_________ ____ ___ __________ ___ ___ __________ ____ __________ ____.
___ ___ ______ _________ _______ _________ _____ ______ __________.
_______ ____ _____ ______ _______.
Get Full Answer on WhatsApp
IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★