Question: answer it correctly for questions 4 & 5 using C program . take your time Design an efficient algorithm that achieves the following t ask:

answer it correctly for questions 4 & 5 using C program . take your time
Design an efficient algorithm that achieves the following t ask: Given an array A[1.n] of floating point numbers, it returns a two-dimensional array, say M, of size nn in which the entry M[i][j] for ij contains the average of the array entries A[i] through A[j]. That is: if ij, then M[i][j]=ji+1A[i]++A[j] whereas for i>j we have that M[i][j]=0. 1. Describe your idea for an algorithm that creates this matrix. 2. Write down the algorithm in pseudocode. 3. How many assignments will your algorithm perform for an input of size n ? 4. Implement the algorithm in the ArrayofAverages class. 5. Write code to measure the running time of your Java or C program for random inputs of size n=10,100,1000, etc. Does the growth of the running time correspond to your estimate of the number of assignments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
