Question: C language Write the recursive selection sort function definition that sorts an array of integer of length n. The selection sort function searches the array

C language
Write the recursive selection sort function definition that sorts an array of integer of length n. The selection sort function searches the array to find the largest element, then swap it with the last element in the array, then it calls itself(selection_sort) recursively to sort the first n-1 element of the array. Assume the find_largest function is provided, which returns the pointer pointing to the largest value of the array a of length n. intfind_largest(int *a, int n); Use pointers and pointer arithmetic to process arrays. In other words, eliminate the loop index variables and all use of the [] operator in the functions. void selection_sort(int 'a, int n){ //function returns when the array length becomes 1 if(n== 1) return; //add your code }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
