Question: Question 3 ( 2 0 . 0 marks ) Your lecturer is a funny guy; given an unsorted list of integer numbers of n elements,

Question 3(20.0 marks) Your lecturer is a funny guy; given an unsorted list of integer numbers of n elements, and to find the sum of all the numbers in the list, he will use the following algorithms. function Sum(A, left, right) if left > right: return 0 else if left = right: return A[left] mid = floor((left+right)/2) Isum = Sum(A, left, mid) rsum = Sum(A, mid+1, right) return Isum + rsum + A[mid) function myMethod(A, N) B = new Array of length 1 B[0]= Sum(A,0, N-1) return B (a) Analyse the asymptotic run-time complexity of the method myMethods. Give the worst-case and the best-case running time in terms of o notation. Justify your answer. (15.0 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!