/* This is an assignment to make an array, then, uh, sort it. */ /* The algorithm here assumes that all entries in the list are bigger than -1. */ #include #include #define ARRAYMAX 10 int array_thing[ARRAYMAX]; int sorted_array[ARRAYMAX]; /* This puts he numbers 1 to 10 in an array. */ void placearray(int* array) { int i; for (i=0; i biggest) { biggest = array[i]; } } return(biggest); } /* This finds the largest integer in an array of integers, and removes that element from the list, by setting it to -1 */ int getbiggestAndRemoveIt(int* array) { int i; int iBiggest; int biggest; biggest = array[0]; iBiggest = 0; for (i=1; i biggest) { biggest = array[i]; iBiggest = i; } } array[iBiggest] = -1; // smaller than any number in our list. return(biggest); } /* This will sort array1, from greatest value to smallest, into array2 */ void sortarray(int* array1, int* array2) { int i; int x; for (i=0; i