...
Question 280 – Operating-Systems
April 10, 2024
Question 11591 – Databases
April 11, 2024
Question 280 – Operating-Systems
April 10, 2024
Question 11591 – Databases
April 11, 2024

Question 11775 – Greedy-approach

In which order the edges of the given graph are chosen while constructing the minimum spanning tree using prim’s algorithm?

Correct Answer: A

Question 2 Explanation: 
The Prim’s algorithm operates by building this tree one vertex at a time, from an arbitrary starting vertex, at each step adding the cheapest possible connection from the tree to another vertex.
B cant be the answer because after edge (1,6) is considered then (3,4) cant be taken because vertex 3 or 4 is not connected directly to the tree having edge (1,6).
C cant be the answer. Same reason as B.
D cant be the answer because after edge (3,2) is considered then next cheapest edge is (2,7) and not (4,7).

A
(1, 6), (6, 5), (5, 4), (4, 3), (3, 2), (2, 7)
B
(1, 6), (3, 4), (2, 7), (2, 3), (7, 4), (5, 4)
C
(1, 6), (3, 4), (2, 7), (4, 5), (1, 2), (5, 6)
D
(1, 6), (6, 5), (5, 4), (4, 3), (3, 2), (4, 7)
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!