import java.util.Vector; public class TestSelectionSort { public static void main(String[] args) { int[] somearray={3,15,-2,6,25,18,10,22,1}; int[] newarray=selectionSort(somearray); for(int i=0; i sorted[index]) { index=k; } } // Now swap array elements int temp=sorted[index]; sorted[index]=sorted[sorted.length-j-1]; sorted[sorted.length-j-1]=temp; }//end top for return sorted; } public Vector selectionSortVector(Vector vec) { Vector v=new Vector(); for (int i=0; i