Question

In: Computer Science

For the 0-1 Knapsack algorithm, is it necessary to maintain the entire 2-dimensional table in memory...

For the 0-1 Knapsack algorithm, is it necessary to maintain the entire 2-dimensional table in memory throughout the computation, in order to compute the value of the best packing of the knapsack?

For the 0-1 Knapsack algorithm, is it necessary to maintain the entire 2-dimensional table in memory throughout the computation, in order to identify the items that are included in an optimal packing of the knapsack?

For the Longest Common Subsequence algorithm, is it necessary to maintain the entire 2-dimensional table in memory throughout the computation, in order to compute the actual characters in a longest-common-subsequence?

Yes/No then why. Short answers please

Solutions

Expert Solution


Related Solutions

In C++ or Java Write the Greedy programming Algorithm for the 0-1 Knapsack problem.                    (a)...
In C++ or Java Write the Greedy programming Algorithm for the 0-1 Knapsack problem.                    (a) No fraction allowed Max Weight W= 9 item 1: profit $20, weight 2, prof/weight=$10 item 2: profit $30, weight 5, prof/weight=$6 item 3: profit $35, weight 7, prof/weight=$5 item 4: profit $12, weight 3, prof/weight=$4 item 5: profit $3, weight 1, prof/weight=$3
Recall the dynamic programming algorithm we saw in class for solving the 0/1 knapsack problem for...
Recall the dynamic programming algorithm we saw in class for solving the 0/1 knapsack problem for n objects with a knapsack capacity of K. In particular, we characterized our recurrence OPT(j, W) to be following quantity: OPT(j, W) := The maximum profit that can be obtained when selecting from objects 1, 2, . . . , j with a knapsack capacity of W , where (after filling in our dynamic programming table), we return the value stored at OPT(n, K)...
. We have the following algorithm. Algorithm Novel(X[0..m-1, 0..m-1]) //Input: A matrix X[0..m-1, 0..m-1] of real...
. We have the following algorithm. Algorithm Novel(X[0..m-1, 0..m-1]) //Input: A matrix X[0..m-1, 0..m-1] of real numbers for i←0 to m-2 do for j←i+1 to m-1 do    if X[i,j] ≠X[j, i]        return false return true a.   What does this algorithm compute? b. What is its basic operation? c. How many times is the basic operation executed? d. What is the efficiency class of this algorithm?
Prove that the 0/1 KNAPSACK problem is NP-Hard. (One way to prove this is to prove...
Prove that the 0/1 KNAPSACK problem is NP-Hard. (One way to prove this is to prove the decision version of 0/1 KNAPSACK problem is NP-Complete. In this problem, we use PARTITION problem as the source problem.) (a) Give the decision version of the O/1 KNAPSACK problem, and name it as DK. (b) Show that DK is NP-complete (by reducing PARTITION problem to DK). (c) Explain why showing DK, the decision version of the O/1 KNAPSACK problem, is NP-Complete is good...
1. Sketch a connected 2-dimensional complex with three 2-cells, 8 1- cells, and 5 0-cells. Draw...
1. Sketch a connected 2-dimensional complex with three 2-cells, 8 1- cells, and 5 0-cells. Draw three examples of a connected 1-dimensional complex with 7 0-cells and 6 1-cells. Sketch a connected 1-dimensional complex with 7 0-cells and 7 1-cells. Sketch a connected 1-dimensional complex with 7 0-cells and 8 1-cells. Is it possible to construct a connected 1-dimensional complex with 8 0-cells and 6 1-cells? Explain.
Provide the dynamic-programming recurrence for a function that is used to solve 0-1 Knapsack. Clearly define...
Provide the dynamic-programming recurrence for a function that is used to solve 0-1 Knapsack. Clearly define what the function is computing.
What are the different algorithms we may use to solve the 0/1 Knapsack problem? Compare and...
What are the different algorithms we may use to solve the 0/1 Knapsack problem? Compare and contrast the different methods.
0. 0. 0. 0.0. 0. 0. 0. 0. 1. 1. 1. 1. 1. 1. 2. 2. 2. 3. 4.
0. 0. 0. 0.0. 0. 0. 0. 0.   1. 1. 1. 1. 1. 1. 2. 2. 2. 3.   4. A.)MEAN – B.)MEDIAN - C.)MODE - D.)STANDARD DEVIATION – E.)5 NUMBER SUMMARY – F.)BOX AND WHISKERS PLOT – G.) OUTLIERS-
0. 0. 0. 0.0. 0. 0. 0. 0. 1. 1. 1. 1. 1. 1. 2. 2. 2. 3. 4.
0. 0. 0. 0.0. 0. 0. 0. 0.   1. 1. 1. 1. 1. 1. 2. 2. 2. 3.   4. A.)5 NUMBER SUMMARY – B.)BOX AND WHISKERS PLOT – C.) OUTLIERS-
Let A =   [  0 2 0 1 0 2 0 1 0 ]  . (a)...
Let A =   [  0 2 0 1 0 2 0 1 0 ]  . (a) Find the eigenvalues of A and bases of the corresponding eigenspaces. (b) Which of the eigenspaces is a line through the origin? Write down two vectors parallel to this line. (c) Find a plane W ⊂ R 3 such that for any w ∈ W one has Aw ∈ W , or explain why such a plain does not exist. (d) Write down explicitly...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT