Question: 2- Array of Averages (10 marks) Design an efficient algorithm that achieves the following task: Given an array A[1..n] of floating point numbers, it returns

 2- Array of Averages (10 marks) Design an efficient algorithm that

2- Array of Averages (10 marks) Design an efficient algorithm that achieves the following task: Given an array A[1..n] of floating point numbers, it returns a two-dimensional array, say M, of size n x n in which the entry M[i][j] for i j we have that M[i][j] = 0. 1- Describe the algorithm that creates this matrix in pseudocode. 2- What is the running time of your algorithm with respect to the array size n? 3- Implement the algorithm in Java. 4- Measure the running time of your Java program for random inputs of size n = 10,100,1000, etc. Does the growth of the running time correspond to your estimates

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!