@@ -0,0 +1,2078 @@
+/**%0A*Implementation of Selection Sort in java%0A* Sorted in Decending order%0A*%0A*@author Subham Mishra%0A**/%0A%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0Aimport java.util.ArrayList;%0Aimport java.util.Iterator;%0A%0Apublic class SelectionSort %7B%0A    %0A    private static void swap(int%5B%5D a, int i, int j) %7B%0A        int temp = a%5Bi%5D;%0A        a%5Bi%5D = a%5Bj%5D;%0A        a%5Bj%5D = temp;%0A    %7D%0A    %0A    public static int%5B%5D selectionSort(int%5B%5D list) %7B%0A        for (int i = 0; i %3C list.length - 1; i++) %7B%0A            // Find the index of the minimum value%0A            int minPos = i;%0A            for (int j = i + 1; j %3C list.length; j++) %7B%0A                if (list%5Bj%5D %3C list%5BminPos%5D) %7B%0A                    minPos = j;%0A                %7D%0A            %7D%0A            swap(list, minPos, i);%0A        %7D%0A        return list;%0A    %7D%0A    %0A    %0A    %0A    public static void main(String args%5B%5D) throws Exception%0A    %7B%0A        String list=%22%22;%0A        int i=0,n=0;%0A        %0A        SelectionSort s= new SelectionSort();%0A        ArrayList%3CInteger%3E arrlist=new ArrayList%3CInteger%3E();%0A        System.out.println(%22 %22);%0A        System.out.println(%22 %22);%0A        System.out.println(%22Please enter the list of elements,one element per line%22);%0A        System.out.println(%22 write 'STOP' when list is completed %22);%0A        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));%0A        while(!(list=bf.readLine()).equalsIgnoreCase(%22stop%22))%7B%0A            int intelement=Integer.parseInt(list);%0A            arrlist.add(intelement);%0A            %0A        %7D%0A        %0A        int elementlist%5B%5D  = new int%5Barrlist.size()%5D;%0A        Iterator%3CInteger%3E iter = arrlist.iterator();%0A        for (int j=0;iter.hasNext();j++) %7B%0A            elementlist%5Bj%5D = iter.next();%0A        %7D%0A        %0A        elementlist=selectionSort(elementlist);%0A        System.out.println(%22 %22);%0A        System.out.println(%22 %22);%0A        System.out.println(%22 %22);%0A        System.out.println(%22Values after Selection Sort : %22);%0A        for (int j=0;j%3Celementlist.length;j++) %7B%0A            System.out.println(elementlist%5Bj%5D+%22 %22);%0A        %7D%0A    %7D%0A%7D%0A

Create SelectionSort.java