Question: Please explain, thanks! 7. Consider using dynamic programming to rewrite this function: function g(s,i,t,j) if (i - s.length) return 0; if (j -t.length) return 0;

Please explain, thanks! 7. Consider using dynamic programming to rewrite this function:Please explain, thanks!

7. Consider using dynamic programming to rewrite this function: function g(s,i,t,j) if (i - s.length) return 0; if (j -t.length) return 0; return maximum(g (s,i+1,t,j).g(s,i,t,j+1)); else return 1 + g(s,i+1,t,j+1); Assume the use of a table lookup function that incorporates the base cases. What are the largest indices of the dynamic programming table? (A) none of the other answers are correct (B) (s.length) and (t. length+1) (C) (s.length+1) and (t.length) (D) s.length and t.length (E) (s.length+1) and (t.length-1) (F) (s.length-1) and (t.length-1) (G) (s.length+1) and (t.length+1) 8. Continuing from the previous question, how is the dynamic programming table filled? Assume the rows are associated with i and the columns are associated with j (A) rows from low to high and columns from high to low (B) rows from high to low and columns from low to high (C) rows from high to low and columns from high to low (D) rows from low to high and columns from low to high

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!