diff --git a/Sorts/SelectionSort.java b/Sorts/SelectionSort.java index 21fa7151..bc0201ce 100644 --- a/Sorts/SelectionSort.java +++ b/Sorts/SelectionSort.java @@ -1,73 +1,60 @@ +package Sorts; + +import static Sorts.SortUtils.*; + /** * * @author Varun Upadhyay (https://github.com/varunu28) * */ -public class SelectionSort { +public class SelectionSort implements SortAlgorithm { /** * This method implements the Generic Selection Sort * * @param arr The array to be sorted - * @param n The count of total number of elements in array * Sorts the array in increasing order **/ - - public static > void SS(T[] arr, int n) { - - for (int i=0;i> T[] sort(T[] arr) { + int n = arr.length; + for (int i = 0; i < n - 1; i++) { // Initial index of min int min = i; - for (int j=i+1;j 1 4 6 9 12 23 54 78 231 - for(int i=0; i a b c d e - for(int i=0; i