public static <T> int linear(T[] a, T t, Comparator<T> c)
    {
        if (a == null || t == null || c == null)
        {
            throw new IllegalArgumentException();
        }
        if (a.length == 0)
        {
            return -1;
        }
        for (int i = 0; i < a.length; ++i)
        {
            if (c.compare(a[i], t) == 0)
            {
                return i;
            }
        }
        return -1;
    }