edited by
11,475 views
35 35 votes

Consider the following table:

$$\begin{array}{|ll|ll|}\hline & \textbf{Algorithms} &  & \textbf{Design Paradigms} \\\hline  \text{(P)} & \text{Kruskal} & \text{(i)}& \text{Divide and Conquer} \\\hline   \text{(Q)}& \text{Quicksort} & \text{(ii)}  & \text{Greedy} \\\hline  \text{(R)} & \text{Floyd-Warshall} &\text{(iii)}  & \text{Dynamic Programming}  \\\hline  \end{array}$$

Match the algorithms to the design paradigms they are based on.

  1. $(P) \leftrightarrow (ii), (Q) \leftrightarrow (iii), (R) \leftrightarrow (i)$
  2. $(P) \leftrightarrow (iii), (Q) \leftrightarrow (i), (R) \leftrightarrow (ii)$
  3. $(P) \leftrightarrow (ii), (Q) \leftrightarrow (i), (R) \leftrightarrow (iii)$
  4. $(P) \leftrightarrow (i), (Q) \leftrightarrow (ii), (R) \leftrightarrow (iii)$

7 Answers

1 1 vote
Some important points regarding Greedy Vs Dynamic Programming
Greedy: →
It always gives polynomial time complexity
→ It is not an optimal
→ It always selects only either minimum or maximum among all possibilities
→ Ex: Dijkstra’s algorithm for SSSP, Optimal Merge Pattern, Huffman coding, Fractional knapsack problem, etc..,
Dynamic Programming:
→ It gives either polynomial or exponential time complexity.
→ It gives always an optimal result.
→ It checks all possibilities of a problem.
→ Ex: Longest Common sequence, Matrix chain Multiplication, Travelling sales Problem, etc..,
Answer:
Position:
Show:

Related questions

32 32 votes
3 answers 3 answers
12.7k
12.7k views
go_editor asked Feb 12, 2015
12,713 views
Given below are some algorithms, and some algorithm design paradigms. $$\begin{array}{|ll|ll|}\hline \text{1.} & \text{Dijkstra's Shortest Path} & \text{i.} & \text{Divid...
27 27 votes
3 answers 3 answers
8.6k
8.6k views
Kathleen asked Sep 29, 2014
8,648 views
The correct matching for the following pairs is $$\begin{array}{|ll|ll|}\hline \text{A.} & \text{All pairs shortest path} & \text{1.} & \text{Greedy} \\\hline \text{B.} ...
19 19 votes
1 answers 1 answer
9.5k
9.5k views
Misbah Ghaya asked Nov 19, 2016
9,466 views
Match the pairs in the following questions:$$\begin{array}{|ll|ll|}\hline (a) & \text{Strassen's matrix multiplication algorithm} & (p) & \text{Greedy method} \\\hline (...