diff --git a/mm.c b/mm.c new file mode 100755 index 0000000..e41ec6e --- /dev/null +++ b/mm.c @@ -0,0 +1,95 @@ +#include +#include + +#define debug 0 + +// Comparison function for qsort() +int numcmp (const void *a, const void *b) { + int x = *((int*) a); + int y = *((int*) b); + if (x > y) return 1; + if (x < y) return -1; + return 0; +} + +// function to calculate mean +float mean(const int* a, int n){ + float avg =0; + int i; + + for(i=0; i