1.8k views

Match the following:
$$\begin{array}{|ll|ll|}\hline \text{P.} & \text{Prim's algorithm for minimum spanning tree} & \text{i.} & \text{Backtracking} \\\hline \text{Q.} & \text{Floyd-Warshall algorithm for all pairs shortest path} & \text{ii.}& \text{ Greedy method} \\\hline \text{R.} & \text{ Merge sort } & \text{iii.} & \text{ Dynamic programming} \\\hline \text{S.}& \text{Hamiltonian circuit } & \text{iv.} & \text{ Divide and conquer} \\\hline \end{array}$$

1. $\text{P-iii, Q-ii, R-iv, S-i}$
2. $\text{P-i, Q-ii, R-iv, S-iii}$
3. $\text{P-ii, Q-iii, R-iv, S-i}$
4. $\text{P-ii, Q-i, R-iii, S-iv}$

edited | 1.8k views
+13
option c is correct ..
0

## Answer C its  Basic General Queston

by Active (2.5k points)
edited
+1 vote
(1) Prim's algo for mst is application of greedy which give optimal solution as mst .

(2) Floyd warshall algo for all pair shortest path is application of dynamic programming because it covers all possibilities from every vertex

(3)merge sort --divide and conquer

(4) Hamiltonian circuit is application of backtracking because we have to find cycle again and again until we didn't get cycle of all vertices without repetition of vertices except source vertex.
by Boss (10.8k points)

A)P. Prim's algorithm for minimum spanning tree  ----->ii.  Greedy method

Q. Floyd-Warshall algorithm for all pairs shortest paths------>iii. Dynamic programming

R. Mergesort ----->iv.  Divide and conque.

S. Hamiltonian circuit    ---->i.   Backtracking

by Boss (36.5k points)

Explanation

Prim's algo. always chooses minimum adj. edge using greedy techneque.

Floyd is a dynamic programming techneque.

Merge is a divide & conqure as we first divide the given array till single element and then merge them in single sorted array.

Hamiltoninan uses back tracking.

P-2

Q-3

R-4

S-1

by (429 points)