Question: Language: C99 Use array pointer notation struct statistics { int min; int max; int sum; }; Write the following functions: void stats(const int *a, int

Language: C99

Use array pointer notation

struct statistics { int min; int max; int sum; };

Write the following functions:

void stats(const int *a, int len, struct statistics *s) which mutates the fields of the struct statistics (see the starter file) so that the maximum, minimum and sum fields are the maximum, minimum and sum of the array elements in a respectively.

double mean(const int a[], int len) which returns the mean of the elements of the array.

double var(const int a[], int len) which returns the variance of the elements of the array.

int median(int a[], int len) which returns the median element of the array. Recall that the median of a list of numbers is the middle most element when the list is sorted. If there are an even number of elements, take the average of the middle two elements and round towards zero (ie. use integer division). Hint: You will need to mutate the array.

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!