Write a function void sort(int A[ ], int N) that uses selection sort algorithm to sort in
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a function void sort(int A[ ], int N) that uses selection sort algorithm to sort in descending order the given array A having N elements.To test out your function use the following main program:
int main()
{
int M[20];
int i;
for (i=0; i<20; i++) M[i]=rand()%90+10;
cout << ”Unsorted Data:” << endl;
for (i=0) i<20; i++) cout << M[i] << ” ”;
cout < sort(M,20); cout<<"Sorted Data"< for(i=0)i<20; i++) cout< cout< return 0; }
Related Book For
Posted Date: