4 research outputs found

    Average case considerations for Mergelnsertion

    Get PDF
    The MergeInsertion Algorithm, also known as Ford-Johnson Algorithm, is a sorting algorithm that was discovered by Ford and Johnson in 1959. It was later described by Knuth as MergeInsertion. The algorithm can be divided into three steps: First pairs of elements are compared. Then the larger half is sorted using MergeInsertion. And last the remaining elements are inserted. The most interesting property of this algorithm is the number of comparisons it requires, which is close to the information-theoretic lower bound. While the worst-case behavior is well understood, only little is known about the average-case. This thesis takes a closer look at the average case behavior. An upper bound of n log n − 1.4005n + o(n) is established. For small n the exact values are calculated. Furthermore the impact of different approaches to binary insertion on the number of comparisons is explored. To conclude we perform some experiments to evaluate different approaches on improving MergeInsertion

    QuickXsort: A Fast Sorting Scheme in Theory and Practice

    Get PDF
    QuickXsortis a highly efficient in-place sequential sorting scheme that mixesHoare’sQuicksortalgorithm with X, where X can be chosen from a wider rangeof other known sorting algorithms, likeHeapsort,InsertionsortandMergesort.Its major advantage is thatQuickXsortcan be in-place even if X is not. In thiswork we provide general transfer theorems expressing the number of comparisonsofQuickXsortin terms of the number of comparisons of X. More specifically,if pivots are chosen as medians of (not too fast) growing size samples, the aver-age number of comparisons ofQuickXsortand X differ only byo(n)-terms. Formedian-of-kpivot selection for some constantk, the difference is a linear term whosecoefficient we compute precisely. For instance, median-of-threeQuickMergesortuses at mostnlgn−0.8358n+O(logn)comparisons. Furthermore, we examine thepossibility of sorting base cases with some other algorithm using even less compar-isons. By doing so the average-case number of comparisons can be reduced down tonlgn−1.4112n+o(n)for a remaining gap of only 0.0315ncomparisons to the knownlower bound (while using onlyO(logn)additional space andO(nlogn)time over-all). Implementations of these sorting strategies show that the algorithms challengewell-established library implementations like Musser’sIntrosort

    On the Average Case of MergeInsertion

    No full text
    corecore