![]() |
|
Solve 7.25,7.26 and 7.27 form Algorithms and Data Structures : The Science of Computing available from Ebrary. 7.25 Consider the following alternative to this chapter's powerOf2 algorithm:
Estimate the execution time of this algorithm. 7.26 Redo the analysis of powerOf 2's execution time, counting
Do these more complete analyses still suggest execution times more or less proportional to 2n, or do the times become even worse? 7.27 What function of x does the following algorithm compute (assume x is a natural number)?
(Hint: The algorithm practically is a recurrence relation for the function it computes. Write this recurrence explicitly, and then find a closed form for it.) |
|