Question: help me answer these two questions, thanks 1. Consider the following recursive algorithm. Algorithm Q(n) /Input: A positive integer n ifn= 1 return l else

help me answer these two questions, thanks
1. Consider the following recursive algorithm. Algorithm Q(n) /Input: A positive integer n ifn= 1 return l else return Q(n - 1) +2 n-1 a. Set up a recurrence relation for this function's values and solve it to determine what this algorithm computes. You should give the initial conditions. b. What is the basic operation of this algorithm? Set up a recurrence relation for the number of basic operations made by this algorithm and solve it. You need to write the exact mathematical function. Hints: a. Note that you are asked about a recurrence for the function's output values, not about a recurrence for the number of times its operatiomis executed. Just follow the pseudo code to set it up. It is easier to solve this recurrence bf forward substitutions (see Appendix B b. This question is very similar to one we have already discussed in class. (10pts) (10pts) )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
