Design And Analysis Of Algorithms Set 7
On This Page
This set of Design and Analysis of Algorithms Multiple Choice Questions & Answers (MCQs) focuses on Design And Analysis Of Algorithms Set 7
Q1 | Which of the following is false in the case of a spanning tree of a graph G?
- it is tree that spans g
- it is a subgraph of the g
- it includes every vertex of the g
- it can be either cyclic or acyclic
Q2 | Every graph has only one minimum spanning tree.
- true
- false
Q3 | Consider a complete graph G with 4 vertices. The graph G has spanning trees.
- 15
- 8
- 16
- 13
Q4 | The travelling salesman problem can be solved using
- a spanning tree
- a minimum spanning tree
- bellman – ford algorithm
- dfs traversal
Q5 | Consider the graph M with 3 vertices. Its adjacency matrix is shown below. Which of the following is true?
- graph m has no minimum spanning tree
- graph m has a unique minimum spanning trees of cost 2
- graph m has 3 distinct minimum spanning trees, each of cost 2
- graph m has 3 spanning trees of different costs
Q6 | Consider a undirected graph G with vertices { A, B, C, D, E}. In graph G, every edge has distinct weight. Edge CD is edge with minimum weight and edge AB is edge with maximum weight. Then, which of the following is false?
- every minimum spanning tree of g must contain cd
- if ab is in a minimum spanning tree, then its removal must disconnect g
- no minimum spanning tree contains ab
- g has a unique minimum spanning tree
Q7 | If all the weights of the graph are positive, then the minimum spanning tree of the graph is a minimum cost subgraph.
- true
- false
Q8 | Consider the graph shown below. Which of the following are the edges in the MST of the given graph?
- (a-c)(c-d)(d-b)(d-b)
- (c-a)(a-d)(d-b)(d-e)
- (a-d)(d-c)(d-b)(d-e)
- (c-a)(a-d)(d-c)(d-b)(d-e)
Q9 | Which of the following is not the algorithm to find the minimum spanning tree of the given graph?
- boruvka’s algorithm
- prim’s algorithm
- kruskal’s algorithm
- bellman–ford algorithm
Q10 | Which of the following is false?
- the spanning trees do not have any cycles
- mst have n – 1 edges if the graph has n edges
- edge e belonging to a cut of the graph if has the weight smaller than any other edge in the same cut, then the edge e is present in all the msts of the graph
- removing one edge from the spanning tree will not make the graph disconnected
Q11 | Kruskal’s algorithm is used to
- find minimum spanning tree
- find single source shortest path
- find all pair shortest path algorithm
- traverse the graph
Q12 | Kruskal’s algorithm is a
- divide and conquer algorithm
- dynamic programming algorithm
- greedy algorithm
- approximation algorithm
Q13 | What is the time complexity of Kruskal’s algorithm?
- o(log v)
- o(e log v)
- o(e2)
- o(v log e)
Q14 | Consider the following graph. Using Kruskal’s algorithm, which edge will be selected first?
- gf
- de
- be
- bg
Q15 | Which of the following edges form minimum spanning tree on the graph using kruskals algorithm?
- (b-e)(g-e)(e-f)(d-f)
- (b-e)(g-e)(e-f)(b-g)(d-f)
- (b-e)(g-e)(e-f)(d-e)
- (b-e)(g-e)(e-f)(d-f)(d-g)
Q16 | Which of the following is false about the Kruskal’s algorithm?
- it is a greedy algorithm
- it constructs mst by selecting edges in increasing order of their weights
- it can accept cycles in the mst
- it uses union-find data structure
Q17 | Kruskal’s algorithm is best suited for the dense graphs than the prim’s algorithm.
- true
- false
Q18 | Kruskal’s algorithm can efficiently implemented using the disjoint-set data structure.
- s1 is true but s2 is false
- both s1 and s2 are false
- both s1 and s2 are true
- s2 is true but s1 is false
Q19 | Which of the following is true?
- prim’s algorithm initialises with a vertex
- prim’s algorithm initialises with a edge
- prim’s algorithm initialises with a vertex which has smallest edge
- prim’s algorithm initialises with a forest
Q20 | Worst case is the worst case time complexity of Prim’s algorithm if adjacency matrix is used?
- o(log v)
- o(v2)
- o(e2)
- o(v log e)
Q21 | Prim’s algorithm is a
- divide and conquer algorithm
- greedy algorithm
- dynamic programming
- approximation algorithm
Q22 | Prim’s algorithm resembles Dijkstra’s algorithm.
- true
- false
Q23 | Kruskal’s algorithm is best suited for the sparse graphs than the prim’s algorithm.
- true
- false
Q24 | Prim’s algorithm can be efficiently implemented using for graphs with greater density.
- d-ary heap
- linear search
- fibonacci heap
- binary search
Q25 | Which of the following is false about Prim’s algorithm?
- it is a greedy algorithm
- it constructs mst by selecting edges in increasing order of their weights
- it never accepts cycles in the mst
- it can be implemented using the fibonacci heap