The Gateway to Computer Science Excellence
+21 votes

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}$
in Algorithms by Boss (30.7k points)
edited by | 1.8k views
option c is correct ..

Answer C its  Basic General Queston

4 Answers

+13 votes
Best answer
by Active (2.5k points)
edited by
+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)
0 votes

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)
0 votes

C is answer


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.





by (431 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,279 answers
104,838 users