Question: Show me the steps to solve Consider Algorithm 2 in lec 3 . pdf , slide 5 . 1 1 . Modify the algorithm to

Show me the steps to solve Consider Algorithm 2 in lec3.pdf, slide 5.
1
1. Modify the algorithm to cube b instead of squaring it in every re-
cursive call.
[0.5 point]
2. Given inputs b and p in Z+, what are the best-case, worst-case, and
average-case complexity of the modified algorithm? [0.5 point]
3. Identify the inputs for which your algorithm performs the minimum
and those for which the algorithm performs the maximum number
of computations in terms of your inputs (not exact numbers, but the
properties that have to be satisfied by the said inputs).[0.5 point]
4. Use big-O, big-\theta , and big notation to measure the performance of
your algorithm. Justify your answers. [0.5 point]
5. How does your algorithm perform compared to Algorithm 2 in the
notes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!