Question: c ++ program change this so it sorts the numbers from smallest to largest order by moving the smallest to the beginning: void Sort(int array[],

c ++ program

change this so it sorts the numbers from smallest to largest order by moving the smallest to the beginning:

void Sort(int array[], int N) { int lrgIndx; int temp;

for(int last = N-1; last >= 1; last--) { lrgIndx = 0; for(int i = 1; i <= last; i++) { if(array[i] > array[lrgIndx]) lrgIndx = i; } temp = array[lrgIndx]; array[lrgIndx] = array[last]; array[last] = temp; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!