7,466 views
1 1 vote

Unlike greedy algorithms, dynamic programming method always provide correct/optimal solution.

Is the above statement correct?

1 Answer

0 0 votes
If we compare greedy paradigm with dynamic programming we will see that the former first makes a choice and on the basis of that choice we move forward based on our assumption that the choice which we had made in the first position was correct. Where as in the case of Dynamic Programming first the computations are made and then we make a choice based on our "computations".

Coming to the statement:"Unlike greedy algorithms, dynamic programming method always provide correct/optimal solution.", if we consider the case of a multistage graph problem the answer which we get by the greedy approach is not always the correct answer, but dynamic programming efficiently solves this problem using memoization technique.

If by optimal solution we mean that the solution provided to us is correct then the given statement is correct.
Position:
Show:

Related questions

0 0 votes
2 2 answers
3.9k
3.9k views
Lakshman Bhaiya asked Nov 13, 2018
3,858 views
Consider the following code segment to find the $n^{th}$ Fibonacci number:Fib(n) { if(n==0) {return 0;} if(n==1) {return 1;} else { return(Fib(n-1) + Fib(n...
3 3 votes
2 answers 2 answers
969
969 views
Bikram asked May 26, 2017
969 views
Match the following:$\begin{array}{|l|l|l|l|} \hline (1) & \text{Multistage graph} & (P) & \text{Divide and conquer}\\ \hline (2) & \text{Convex hull } & (Q) & \text{Dept...
0 0 votes
1 1 answer
138
138 views
Shubham Sharma 2 asked Apr 19
138 views
Match the LIST-I with LIST-IILIST-ILIST-IIA.Dynamic programmingI.Floyd Warshall Shortest pathB.GreedyII.Huffman codingC.Back trackingIII.Hamiltonian cycle problemD.Branch...
3 3 votes
3 3 answers
7.0k
7.0k views
Arjun asked Jul 2, 2019
6,980 views
Consider the following steps:$S_1$: Characterize the structure of an optimal solution$S_2$: Compute the value of an optimal solution in bottom-up fashionWhich of the foll...