Question: Q 1 ) This question is concerned with the design and analysis of recursive algorithms. You are given a problem statement as shown below. This
Q This question is concerned with the design and analysis of recursive algorithms. You are given a problem statement as shown below. This problem is concerned with performing calculations on a sequence A of real numbers. Whilst this could be done using a conventional loopbased approach, your answer must be developed using a recursive algorithm. No marks will be given if your answer uses loops. FindSumP os And Negaan Input: A sequence of real values A azan such that no values of A are Output: A tuple sum sum containing the sum suml of all the positive values and the sum sum of the negative value of the elements in A Your recursive algorithm should use a single recursive structure to find the sum values and should not use two separate instances of a recursive design. a Produce a pseudo code design for a recursive algorithm to solve this problem. Please write your answer in the answer sheet. marksb Draw a callstack diagram in your answer sheet to show the application of your recursive algorithm when called using the sequence marksc Write down the set of recurrence equations for your recursive algorithm. The recurrence equations in the answer sheet should take a form like this: Tnexpressionexpression otherwise The "otherwise" case here refers to the recursive algorithm base case. marksd Using the recurrence equations, you gave in your answer for part c determine the running time complexity of your recursive algorithm. Put your analysis in your answer sheet. marks
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
