Quiz Minimum Spanning Tree - Prim's Algorithm

Ace your homework & exams now with Quizwiz!

The implementation of Lazy Prim's algorithm computes the minimum spanning tree in time proportional to E log E. However, it requires extra space proportional to __________ .

E

Which of the following best describes the eager implementation of Prim's algorithm? A) Start with the shortest edge and greedily grow tree T. Add the minimum weight edge, that has exactly one endpoint in T Repeat until T includes V-1 edges B) Start with the shortest edge and greedily grow tree T. Add the minimum weight edge, that has no endpoint in T Repeat until T includes V-1 edges C) Start with vertex 0 and greedily grow tree T. Add the minimum weight edge, that has exactly one endpoint in T Repeat until T includes V-1 edges D) Start with vertex 0 and greedily grow tree T. Add the minimum weight edge, that has no endpoint in T Repeat until T includes V-1 edges

C

Which of the following best describes the lazy implementation of Prim's algorithm? A) Start with the shortest edge and greedily grow tree T. Add the minimum weight edge, that has exactly one endpoint in T Repeat until T includes V-1 edges B) Start with the shortest edge and greedily grow tree T. Add the minimum weight edge, that has no endpoint in T Repeat until T includes V-1 edges C) Start with vertex 0 and greedily grow tree T. Add the minimum weight edge, that has exactly one endpoint in T Repeat until T includes V-1 edges D) Start with vertex 0 and greedily grow tree T. Add the minimum weight edge, that has no endpoint in T Repeat until T includes V-1 edges

C

In order to be able to efficiently update elements on the priority queue Prof. Sedgewick uses an indexed priority queue called IndexMinPQ. Below you find some statements about IndexMinPQ. One of the statements is wrong. Find the incorrect statement. -IndexMinPQ has 2 constructors: a default constructor and a constructor that specifies the maximum amount of keys that will ever be in the priority queue. -IndexMinPQ allows the client to update the key by specifying the index and the new value. -IndexMinPQ has a method contains that checks whether a given index is on the priority queue You Answered -IndexMinPQ uses parallel arrays to access quickly the information that is needed

IndexMinPQ has 2 constructors: a default constructor and a constructor that specifies the maximum amount of keys that will ever be in the priority queue.

Prim's algorithm always connects to the tree the edge that is closest to the tree

True

Prim's algorithms requires V insert, V delete-min and E decrease-key. Its running time depends on the implementation of the priority queue. The array implementation is _________________ The binary heap implementation _________________ In performance-critical situations consider _________________

is optimal for dense graphs is much faster for sparse graphs a 4-way heap

The video introduces a lazy implementation of Prim's algorithm. It is called lazy implementation because _______________ .

it allows edges on the priority queue that are obsolete

In the eager implementation of Prim's algorithms the priority queue used has at most ____________________ .

one entry per vertex


Related study sets

Information Security Chapter 6 Review Questions

View Set

PrepU Quiz 4 Ch Muscle Relactants

View Set