2. The power function x" where n is a positive integer, can be computed in n multiplications. (a) Design a divide and conquer algorithm that computes x" in O(log n) multiplications. Prove the running time of your algorithm by writing and solving the recurrence relation for the number of multiplications. (b) Is your algorithm optimal? Explain one way or another.

icon
Related questions
Question

2

2. The power function x" where n is a positive integer, can be computed in n multiplications.
(a) Design a divide and conquer algorithm that computes x" in O(log n) multiplications.
Prove the running time of your algorithm by writing and solving the recurrence relation
for the number of multiplications.
(b) Is your algorithm optimal? Explain one way or another.
Transcribed Image Text:2. The power function x" where n is a positive integer, can be computed in n multiplications. (a) Design a divide and conquer algorithm that computes x" in O(log n) multiplications. Prove the running time of your algorithm by writing and solving the recurrence relation for the number of multiplications. (b) Is your algorithm optimal? Explain one way or another.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer