Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( a ) Describe your algorithm clearly in English. ( b ) Give pseudocode. ( c ) Argue correctness, even if you don t give
a Describe your algorithm clearly in English.
b Give pseudocode.
c Argue correctness, even if you dont give a formal proof and give a convincing
argument instead.
d Give with explanation the best upper bound that you can for the running time
ii points Give a nonrecursive algorithm that asymptotically performs fewer addi
tions than the recursive algorithm. Discuss the running time of the new algorithm.
iii points Give an algorithm to compute in time using only integer
additions and multiplications.
Hint: Observe that
Can you use this observation to compute
iv points The Fibonacci Plus numbers are defined below a and are all inte
gers
Give an algorithm to compute in time.
Hint: Similarly to part iii find a suitable matrix to apply to the initial vector
so that is an entry of the resulting vector. Other choices of
initial vectorand accordingly, matrixmay work too. Then show how to compute
b points Now assume that adding two bit integers requires time and that
multiplying two bit integers requires time. Analyze the running time of the first
three algorithms in part a under this more reasonable cost measure for the elementary
arithmetic operations.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started