在将我的快速排序实现与我的编译器上的std::sort以及mergesort的实现进行比较时,我注意到大型数据集上有一种奇怪的模式:当对64位整数进行操作时,快速排序始终比mergesort快;然而,在较小的int大小上,快速排序变得更慢,而mergesort则变得更快。(first, last, quicksort_pivot_back<Iterator>);
quicksort_loop(bounds.second, last);run_trial<
我写了Quicksort和Mergesort,并给他们写了一个基准,看看它们有多快。sorted_list_qsort = qsort(random_list)
print ("That is a sorted list with Quicksort"][i], times["Quicksort"][i]))
#----------------------------------End of Benchmarking-