Modify selection_sortc so that it includes the following functions: void selection_sort(int "a, int n); int *find_largestlint *a, int n); void swap(int "p, int *a); selection_sort function: it should...


Modify selection_sortc so that it includes the following functions: void selection_sort(int
#define N 10 void selection_sort(int "a, int n); int main(void) int i: int "a: printfl"Enter %d numbers to be sorted: ", N): for (i = 0: i< n;="" i++)="" scanf("56c",="" &"a):="" selection_sort"a,="" n):="" printf("in="" sorted="" order:"):="" for="" (i="0;">< n;="" i++)="" printf("="" 9%dl",="" "a);="" printfl"\n"):="" return="" 0:="" void="" selection_sort(int="" "a,="" int="" n)="" int="" i,="" largest="0," temp:="" if="" (n="=" 1)="" retum;="" for="" (i="1;">< n;="" i++)="" if="" ("a=""> a[largest) largest = i; if (largest
Extracted text: Modify selection_sortc so that it includes the following functions: void selection_sort(int "a, int n); int *find_largestlint *a, int n); void swap(int "p, int *a); selection_sort function: it should call ind_largest function and swap function. find_largest function: when passed an array of length n, the function will return a pointer to the array's largest element. The function should use pointer arithmetic - not subscripting - to visit array elements. In other words, eliminate the loop index variables and all use of the [] operator in the function. swap function: when passed the addresses of two variables, the function should exchange the values of the variables: swap(&i, &): * exchange values of i and j*/ Your program will cal find_largest function and swap function in selection_sort function. "selection_sort.c, project 6, Program Design #include #define N 10 void selection_sort(int "a, int n); int main(void) int i: int "a: printfl"Enter %d numbers to be sorted: ", N): for (i = 0: i< n;="" i++)="" scanf("56c",="" &"a):="" selection_sort"a,="" n):="" printf("in="" sorted="" order:"):="" for="" (i="0;">< n;="" i++)="" printf("="" 9%dl",="" "a);="" printfl"\n"):="" return="" 0:="" void="" selection_sort(int="" "a,="" int="" n)="" int="" i,="" largest="0," temp:="" if="" (n="=" 1)="" retum;="" for="" (i="1;">< n;="" i++)="" if="" ("a=""> a[largest) largest = i; if (largest

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here