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