6 research outputs found

    Average Cost of QuickXsort with Pivot Sampling

    Get PDF
    QuickXsort is a strategy to combine Quicksort with another sorting method X, so that the result has essentially the same comparison cost as X in isolation, but sorts in place even when X requires a linear-size buffer. We solve the recurrence for QuickXsort precisely up to the linear term including the optimization to choose pivots from a sample of k elements. This allows to immediately obtain overall average costs using only the average costs of sorting method X (as if run in isolation). We thereby extend and greatly simplify the analysis of QuickHeapsort and QuickMergesort with practically efficient pivot selection, and give the first tight upper bounds including the linear term for such methods

    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

    Analysis of An Approximate Median Selection Algorithm

    Get PDF
    We present analysis of an efficient algorithm for the approximate median selection problem that has been rediscovered many times, and easy to implement. The contribution of the article is in precise characterization of the accuracy of the algorithm. We present analytical results of the performance of the algorithm, as well as experimental illustrations of its precision
    corecore