Advanced C Programming Spring 2004 Excercise 9E (Extra exercise; qsort) Qsort function is in standard C function library. Qsort can be used to sort all kinds of arrays using different kinds of sorting criterias. That is the reason why qsort is implemented as a generic function. It means, that the user of qsort can decide what is the sorting criteria. The user writes his/her own comparison function to describe how two elements of the array are compared during the sorting process. This comparison function is then passed as a parameter to the qsort function. Qsort functions then calls this comparison function when it has to decide whether to swap the elements of the array or not. It is agreed that comparison function shoud return -1 if the first parameter is less than the second, 0 if they are equal and 1 if the first parameter is greater than the second. The basic idea how qsort can be used to sort the array of persons according their names or ages was presented in the class. To demonstrate the versatility of qsort function for youself write a program that sorts an array of arrays. Now we want that qsort sorts the rows of an two dimensional array so that the row that has smallest sum of elements is as the first row. Remark. You do'nt have to bother yourself with reading the information to the array in the beginning from the keyboard. Instead you can initialize your array in the source code in the following way (this is adequate test to show whether your program works or not) int array[4][3] = { {3, 3, 5}, {2, 2, 5}, {2, 1, 5}, {2, 3, 5} }; In this case your programs output should be as follows: Original array: 3 3 5 2 2 5 2 1 5 2 3 5 Sorted array 2 1 5 2 2 5 2 3 5 3 3 5 Remark. Remember that we now sort the the rows in order. The rows are moved as a whole. In the data above the roes are moved in the following way: Original row no New row no Sum of elements at the new row 0 3 8 1 1 9 2 0 10 3 2 11