public static <T> void selection(T[] a, Comparator<T> c)
    {
        if (a == null || a.length <= 1)
        {
            return;
        }
        int n = a.length;
        for (int i = 0; i < n - 1; ++i)
        {
            int j = i;
            for (int k = i + 1; k < n; ++k)
            {
                if (c.compare(a[k], a[j]) < 0)
                {
                    j = k;
                }
            }
            if (j != i)
            {
                swap(a, i, j);
            }
        }
    }