• edited by
1,881 views
1 1 vote

Consider the following recursive function which is used by dynamic programming:

T(n)= 0 ;if n<1

       = 1;if n=1

      =T(n-1)+T(n-2)+1 ;if n>1      

Assume for every function call  T(i) it checks the table first, if its value is already computed it retrieves the value from table. Otherwise it calls a recursive function call to compute its return value. Whenever a function computes for first time its return value is stored in the table to avoid the redundant function calls. If system allocated 48 bytes for stack allocation, then the maximum value of ‘n’ so that overflow cannot occur ________. (Assume system allocate 4 byte to each stack entry which is sufficient for storing required data.)

Please log in or register to answer this question.

Position:
Show:

Related questions

2 2 votes
1 1 answer
146
146 views
GO Classes asked Aug 22
146 views
True or False:In every dynamic-programming solution, the asymptotic space requirement must be at least as large as the total number of distinct subproblems.True False
2 2 votes
1 1 answer
99
99 views
0 0 votes
1 1 answer
80
80 views
GO Classes asked Aug 22
80 views
An instance of Subset Sum contains:$n$ positive integersa positive target value $m$What is the running time of the standard dynamic-programming solution?$\Theta(m+n)$ $\T...
1 1 vote
1 1 answer
99
99 views
GO Classes asked Aug 22
99 views
There is an unlimited supply of three item types:$$\begin{array}{|c|cc|}\hline\text{Item} & \text{Size} & \text{Value} \\\hlineA & 1 & 2 \\B & 2 & 6 \\C & 3 & 9 \\\hline\...