Question: Determine the processing time T ( n ) of the recursive algorithm: 1 int myTest ( int n ) { 2 if ( n <
Determine the processing time Tn of the recursive algorithm:
int myTest int n
if n return ;
else
int i random n ;
return myTest i myTest n i ;
providing the algorithm random int n spends one time unit to return a random integer value uniformly distributed in the range n whereas all other instructions spend a negligibly small time eg T
Hints: derive and solve the basic recurrence relating Tn in average to Tn T You might need the equation n for deriving the explicit formula for T n
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
