1. Engineering
  2. Computer Science
  3. please help with both question thankyou...

Question: please help with both question thankyou...

Question details

1. Consider the following algorithm Algorithm S(n) f n1 return 1 else return S(n-1) +nnn Set up a recurrence relation for the number of times multiplications is executed by the algorithm Choose one of the following answers. S(n) S(n-1)+1 s(n) = S(n-1 ) + 2 xS(n) - S(n-1)+3 O S(n) = S(n-1 )-1 Answer: S(n) S(n-1)+2 2. Solve the recurrence relation from Question1. Choose one of the following answers. S(n) 2(n-1) S(n) 2n-1 S(n) 2(n+1) s(n) = 2n+1 0

Please help with both question. Thankyou

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution