please tell me about the difference between this

Started by ahmedzaalan, May 16, 2011, 05:10:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ahmedzaalan

please tell me about the difference between
The maximum depth (level) of recursion is 14.
and
The maximum number of recursive calls is 2*nInternalActivities

and what dose you mean by nInternalActivities
thank you

Liviu Lalescu

Please see http://lalescu.ro/liviu/fet/doc/en/generation-algorithm-description.html , step 2 d), and come back here if things are still unclear.

nInternalActivities is the number of active activities, which must be scheduled.

ahmedzaalan

do you mean by The maximum depth (level) of recursion like this:
{swap(x,y)
   swap(x,y)
      swap(x,y)
         swap(x,y)
            swap(x,y)
              ....
               ........14 times}
and do you mean by The maximum number of recursive calls {calls to the function that lead to recursion}???

Liviu Lalescu

Quotedo you mean by The maximum depth (level) of recursion like this:
{swap(x,y)
   swap(x,y)
      swap(x,y)
         swap(x,y)
            swap(x,y)
              ....
               ........14 times}

Yes.

Quote
and do you mean by The maximum number of recursive calls {calls to the function that lead to recursion}???

At level 0, you have to place an activity, A_i. (This is done more times, at least nInternalActivities times). When you start for A_i, at level 0, make count=0. Each call to swap(x,y) will increment count.

Is it clear now?

ahmedzaalan