Question: Find two different approaches to alter the following selectionsort method so that it sorts in descending order instead of ascending order. public static void selectionSort
Find two different approaches to alter the following selectionsort method so that it sorts in descending order instead of ascending order.
public static void selectionSortint elem
for int ; elem.length ;
int minIdx ;
forint ; elem.length;
ifelemk elemminIdx
minIdx;
ifelemminIdx elemj
int temp elemj;
elem elemminIdx;
elemminIdx temp;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
