MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
How many edge are there in MCST generated from graph with ā€˜nā€™ vertices
A
n-1
B
n/2-1
C
n-2
D
n/2
Explanation: 

Detailed explanation-1: -Property 1: A free tree with N >= 1 vertices has exactly N-1 edges.

Detailed explanation-2: -Explanation: A graph can have many spanning trees. And a complete graph with n vertices has n(n-2) spanning trees.

Detailed explanation-3: -And an optimal solution is feasible solution for which rule (A) is maximized. Of these Six feasible solutions, solution 4 yields the maximum profit. Therefore solution 4 is optimal for the given problem instance.

Detailed explanation-4: -An algorithm to construct a Minimum Spanning Tree for a connected weighted graph. It is a Greedy Algorithm. The Greedy Choice is to put the smallest weight edge that does not because a cycle in the MST constructed so far. If the graph is not linked, then it finds a Minimum Spanning Tree.

Detailed explanation-5: -Pseudo code of Greedy Algorithm Initially, the solution is assigned with zero value. We pass the array and number of elements in the greedy algorithm. Inside the for loop, we select the element one by one and checks whether the solution is feasible or not. If the solution is feasible, then we perform the union.

There is 1 question to complete.