Given the following list { 10,9,-2,1}, sort the list using selection sort and fill out the following table.
static void selectionSort(double [] list) {// find minimum in the list [i....list.length-1]for (int i=0;idouble currentMin=list[i];int currentMinIndex=i;for (int j=i+1;jif (currentMin>list[j]){currentMin=list[j];currentMinIndex=j;}}// j for// swap list[i] with list[currentMindIndex ifnecessary.if (currentMinIndex!=i) {list[currentMinIndex]=list[i];list[i]=currentMin;}// if}// for}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here