public int next(int k){
        int index = -1;
        for (int i = 0; i < size; i++)
        {
            if(keyList[i]>k){
                index=i;
                break;
            }
        }
        if (keyList[size-1]<k)
        {
            return size;
        }
        return index;
    }