If Kruskal’s algorithm is used for finding the minimum spanning tree of a weighted graph with n vertices and m edges and edge weights are already given in a sorted list, then, what will be the time complexity to compute the minimum cost spanning tree given that the union and find operations take amortized O(1)?

a. O(m)
b. O(n)
c. O(n logm)
d. O(m logn)

a. O(m)
As you are already given edge weights in a sorted order, you just have to pick the edges in the increasing order and add it to the current spanning set if its addition does not result in a cycle or else throw it away.

Computer Science & Information Technology

You might also like to view...

Which of the following is an industry standard that enables a camera to connect directly to a printer?

A) PictBridge B) Shutterfly C) Flickr D) Geotagging

Computer Science & Information Technology

________ recognizes patterns in data as you type and automatically fills in values for text and numeric data

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology