Consider the following recursive function which is used by dynamic programming:
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 T (i) 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.)
Ans : 12
Doubt :
wont it be the size of active function calls ? so for n=5 its fine, and for n=6 it exceeds 12 , but in given answer n=12 is considered, why ?