Quicksort mais lento que o Mergesort?

Ontem, eu estava trabalhando na implementação de um quicksort e, em seguida, executei-o, esperando um tempo de execução mais rápido que o Mergesort (que eu também havia implementado). Eu executei os dois, e enquanto o quicksort era mais rápido para conjuntos de dados menores <100 elementos (e eufez verifique se ele funciona), o mergesort se tornou o algoritmo mais rápido rapidamente. Ensinaram-me que o quicksort é quase sempre "mais rápido" do que o mergesort, e entendo que há algum debate sobre esse tópico, mas pelo menos esperava que fosse mais próximo do que isso. Para conjuntos de dados> 10000 elementos, o mergesort foi 4 vezes mais rápido. Isso é esperado ou existe um erro no meu código de classificação rápida?

mergesort:

public static void mergeSort(int[ ] e)
{
    if (e.length <= 1) return;
    int[] first = new int[e.length/2];
    int[] second = new int[e.length - first.length];
    System.arraycopy(e, 0, first, 0, first.length);
    System.arraycopy(e, first.length, second, 0, second.length);
    mergeSort(first);
    mergeSort(second);
    System.arraycopy(merge(first, second), 0, e, 0, e.length);
}

private static int[] merge(int[] first, int[] second) {
    int iFirst = 0;
    int iSecond = 0;
    int iCombined = 0;

    int[] combined = new int[first.length + second.length];
    while(iFirst < first.length && iSecond < second.length) {
        if (first[iFirst] > second[iSecond]) {
            combined[iCombined++] = second[iSecond++];
        }
        else combined[iCombined++] = first[iFirst++];
    }
    for(; iFirst < first.length; iFirst++) {
        combined[iCombined++] = first[iFirst];
    }
    for(; iSecond < second.length; iSecond++) {
        combined[iCombined++] = second[iSecond];
    }
    return combined;
}

ordenação rápida:

public static void quicksort(int[] a, int first, int last) {
    if (first >= last) return;

    int partitionIndex = partition(a, first, last);
    quicksort(a, first, partitionIndex - 1);
    quicksort(a, partitionIndex + 1, last);
}

public static int partition(int[] x, int first, int last) {
    int left = first;
    int right = last;
    int pivot = x[first];
    int pivotIdx = first;

    while(left <= right) {
        while(left < x.length && x[left] <= pivot) left++;
        while(right >= 0 && x[right] > pivot) right--;
        if (left <= right) {
            int temp = x[left];
            x[left] = x[right];
            x[right] = temp;
        }
    }
    pivotIdx = right;
    x[first] = x[right];
    x[pivotIdx] = pivot;
    return pivotIdx;
}

questionAnswers(15)

yourAnswerToTheQuestion