The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
70 views

My answer came out to be 13:

because when we will compute T(13)

{

as we are using Dynamic programming , it will have to compute value of T(12),T(11),…...T(2) only once(as it will store it and reuse it)

so the stack size will be 1 (for T(13))+11  (for T(12),T(11),…...T(2)) = 12…...(48/4)

}

will any one help me out

in Algorithms by Active (1.3k points) | 70 views
0
The left branch of the recursion tree will have non computed values , for sure right?

Now how many will be active at maximum ?

T(n) -> T(n-1) -> T(n-2) ->>>>>>>> T(1)

How many are there actually in the stack? N activation records right?

So nx4 = 48 (maximum condition)

Thus n=12 is right.
0
But they are not asking for how many activaion record...

they are asking taht on what max value of n the stack willnot overflow...
0

And what is kept in stack? @Nandkishor3939 Activation Records right?

0
I am concerned about:

"  for which value of n ?? "  is asked and not for "how many AR's"

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,376 questions
55,839 answers
192,571 comments
91,393 users