10 likes | 90 Vues
Circle a set of edges that constitute a minimum spanning tree. Fill in the implementation of Kruskal’s Algorithm and select the best data structure for the priority queue in Prim’s Algorithm.
E N D
12 8 1 2 9 3 4 7 6 12 5 Minimum Spanning Trees Quiz (Easy) • Circle a set of edges that constitute a minimum spanning tree. You may use either algorithm. • Fill in the implementation of Kruskal’s Algorithm: Set A = empty set MinHeap H = empty heap Insert all Edges into H while( ) { //assume E has pointers/references to //its endpoints: a & b Edge E = } Post condition: A is a set of edges constituting a minimum spanning tree. • Circle the best kind of data structure to use for the priority queue in Prim’s algorithm: Binary Heap Binomial Heap Sturgill Heap Union/Find Fibonacci Heap Hash Table Pile Mush