// Path: Java-data-Structures/src/main/java/com/sorting/SelectionSort.java
// public class SelectionSort {
// 
//     /**
//      * Use the selection sort method to sort the given array A
//      * 
//      * @param A
//      *            Array of Comparable that contains the object to sort
//      */
//     public static void sort(Comparable[] A) {
//         if (A == null)
//             return;
//         int indice;
//         int len = A.length;
//         for (int i = 0; i < len - 1; i++) {
//             indice = minIndice(A, i, len);
//             swap(A, indice, i);
//         }
//     }
// 
//     private static boolean less(Comparable[] A, int i, int j) {
//         int cmp = A[i].compareTo(A[j]);
//         if (cmp < 0)
//             return true;
//         return false;
//     }
// 
//     private static void swap(Comparable[] A, int i, int j) {
//         Comparable inter = A[i];
//         A[i] = A[j];
//         A[j] = inter;
//     }
// 
//     private static int minIndice(Comparable[] A, int lo, int hi) {
//         int indice = lo;
//         for (int i = lo + 1; i < hi; i++) {
//             if (less(A, i, indice))
//                 indice = i;
//         }
//         return indice;
//     }
// 
// }


import com.sorting.SelectionSort;
import junit.framework.TestCase;
package com.test.sorting;



public class TestSelectionSort extends TestCase {

    public void testSelectionSort() {

        String[] A = { "zs", "qw", "qr", "miguel", "rtd", "fgs", "qq", "mk", "slao", "oiu", "vf", "xs", "er", "qw",
                "bv" };
        Integer[] B = { 2, 4, 7, 542, 0, 1, 3, 0, 6, 2, 7, 9, 10, 2, 4, 6, 0, 3, 2, 9, 2, 77, 33, 22, 5, 4, 2, 2, 2 };

// Path: Java-data-Structures/src/main/java/com/sorting/SelectionSort.java
// public class SelectionSort {
// 
//     /**
//      * Use the selection sort method to sort the given array A
//      * 
//      * @param A
//      *            Array of Comparable that contains the object to sort
//      */
//     public static void sort(Comparable[] A) {
//         if (A == null)
//             return;
//         int indice;
//         int len = A.length;
//         for (int i = 0; i < len - 1; i++) {
//             indice = minIndice(A, i, len);
//             swap(A, indice, i);
//         }
//     }
// 
//     private static boolean less(Comparable[] A, int i, int j) {
//         int cmp = A[i].compareTo(A[j]);
//         if (cmp < 0)
//             return true;
//         return false;
//     }
// 
//     private static void swap(Comparable[] A, int i, int j) {
//         Comparable inter = A[i];
//         A[i] = A[j];
//         A[j] = inter;
//     }
// 
//     private static int minIndice(Comparable[] A, int lo, int hi) {
//         int indice = lo;
//         for (int i = lo + 1; i < hi; i++) {
//             if (less(A, i, indice))
//                 indice = i;
//         }
//         return indice;
//     }
// 
// }


// Path: Java-data-Structures/src/test/java/com/test/sorting/TestSelectionSort.java
import com.sorting.SelectionSort;
import junit.framework.TestCase;

package com.test.sorting;



public class TestSelectionSort extends TestCase {

    public void testSelectionSort() {

        String[] A = { "zs", "qw", "qr", "miguel", "rtd", "fgs", "qq", "mk", "slao", "oiu", "vf", "xs", "er", "qw",
                "bv" };
        Integer[] B = { 2, 4, 7, 542, 0, 1, 3, 0, 6, 2, 7, 9, 10, 2, 4, 6, 0, 3, 2, 9, 2, 77, 33, 22, 5, 4, 2, 2, 2 };

        SelectionSort.sort(A);