@ -4,12 +4,17 @@
#include <math.h>
double average(const double *data, int n) {
if (n==0) {
return 0;
}
else {
double sum = 0.0;
for (int i = 0; i < n; ++i) {
sum += data[i];
return sum / n;
double median(double *data, int n) {
if (n % 2 == 0) {