- Computer Science Engineering (CSE)
- Design and Analysis of Algorithms
- Which of the following is true?

Q. |
## Which of the following is true? |

A. | prim’s algorithm can also be used for disconnected graphs |

B. | kruskal’s algorithm can also run on the disconnected graphs |

C. | prim’s algorithm is simpler than kruskal’s algorithm |

D. | in kruskal’s sort edges are added to mst in decreasing order of their weights |

Answer» B. kruskal’s algorithm can also run on the disconnected graphs | |

Explanation: prim’s algorithm iterates from one node to another, so it can not be applied for disconnected graph. kruskal’s algorithm can be applied to the disconnected graphs to construct the minimum cost forest. kruskal’s algorithm is comparatively easier and simpler than prim’s algorithm. |

View all MCQs in:
Design and Analysis of Algorithms

- Which of the following statement is true about stack?
- Consider the graph M with 3 vertices. Its adjacency matrix is shown below. Which of the following is true?
- Which of the following is true?
- Which of the following is true about the time complexity of the recursive solution of the subset sum problem?
- Which of the following is not true about subset sum problem?
- Which of the following is true about the time complexity of the recursive solution of set partition problem?
- Consider the expression T & F ∧ T. What is the number of ways in which the expression can be parenthesized so that the output is T (true)?
- What is the maximum number of ways in which a boolean expression with n + 1 terms can be parenthesized, such that the output is true?
- Is it true that every complete bipartite graph is a modular graph.
- Suppose you have coins of denominations 1,3 and 4. You use a greedy algorithm, in which you choose the largest denomination coin which is not greater than the remaining sum. For which of the following sums, will the algorithm produce an optimal answer?

Login to Continue

It will take less than 2 minutes

Report MCQ