CS 1723, Data Structures Assignment 7, Due 18 April 1997 Recursive Insertion Sort For this assignment you are to use recursion to sort an array of integers into increasing order. Use the global variable declaration #define MAXA 20 int a[MAXA]; The sort itself should be a function sortit() with one parameter n: void sortit(int n) /* sort a[0], a[1],..., a[n] into increasing order */ { Assuming n > 0, Find an index maxi such that a[maxi] ³ a[i], for i from 0 to n; /* see maxind() below */ Next interchange a[maxi] with a[n]; /* at this point, a[n] is the correct value */ Finally invoke sortit() recursively with parameter n-1, to sort a[0], a[1],..., a[n-1] into increasing order } You should write a function fetchit() that will read integers from stdin until a zero is encountered, returning the final index in its parameter: void fetchit(int *np) /* read a[0], a[1], ..., a[n], until 0 read, giving n its value at the same time */ Then in the main program, invoke fetchit(&lim), followed by sortit(lim). Finally invoke a function printit(lim) to print the integers out. You must use a recursive function maxind() to find the index of the maximum value in sortit() above: int maxind(int m) /* return the index j satisfying a[j] ³ a[i], for 0 £ i £ m */ if m = 0 then obviously just return m. Otherwise if a[m] > a[maxind(m-1)] then return m. Otherwise return maxind(m-1). Hand in a sample run with input the integers (of which only the first 10 will be sorted): 47 24 52 13 71 41 89 14 12 10 0 For extra credit (or fun), write fetchit() and printit() recursively also (without iteration). Note: This program doesn't follow the usual C convention of working from 0 to n-1, but instead works form 0 to n.