Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning PostgreSQL On The Cloud Simplifying Database As A Service On Cloud Platforms

Authors: Baji Shaik ,Avinash Vallarapu

1st Edition

1484234464, 978-1484234464

Students also viewed these Databases questions

Question

Which of the following statements is true of a breach of contract

Answered: 1 week ago