int a[]= {1000,209,1,5,9,45};//(1,209,1000,5,9,45) //(1,5,1000,209,9,45) //(1,5,9,209,1000,45) //(1,5,9,45,1000,209) // (1,5,9,45,209,1000) ...
int LastElementIndex = arr.length-i-1; //index of last Element after each step int MaxIndex = MaxIndex(arr,0,LastElementIndex); // index of maximum value, in the remaining unsorted array ...