Optimal sampling strategies in quicksort

被引:0
|
作者
Martínez, C [1 ]
Roura, S [1 ]
机构
[1] Univ Politecn Catalunya, Dept Llenguatges & Sistemes Informat, E-08034 Barcelona, Catalonia, Spain
来源
关键词
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
It is well known that the performance of quicksort can be substantially improved by selecting the median of a sample of three elements as the pivot of each partitioning stage. This variant is easily generalized to samples of size s = 2k + 1. For large samples the partitions are better as the median of the sample makes a more accurate estimate of the median of the array to be sorted, but the amount of additional comparisons and exchanges to find the median of the sample also increases. We show that the optimal sample size to minimize the average total cost of quicksort (which includes both comparisons and exchanges) is s = a . root n + o(root n). We also give a closed expression for the constant factor a, which depends on the median-finding algorithm and the costs of elementary comparisons and exchanges. The result above holds in most situations, unless the cost of an exchange exceeds by far the cost of a comparison. In that particular case, it is better to select not the median of the samples, but the (p + 1)(th) element. The value of p can be precisely determined as a function of the ratio between the cost of an exchange and the cost of a comparison.
引用
收藏
页码:327 / 338
页数:12
相关论文
共 50 条
  • [21] Optimal sampling strategies for Bayesian estimation of docetaxel (Taxotere) clearance
    Baille, P
    Bruno, R
    Schellens, JHM
    Webster, LK
    Millward, M
    Verweij, J
    Montay, G
    CLINICAL CANCER RESEARCH, 1997, 3 (09) : 1535 - 1538
  • [22] Optimal sampling strategies for the assessment of inulin clearance in children.
    van Rossum, LK
    Mathot, RA
    Vulto, AG
    CLINICAL PHARMACOLOGY & THERAPEUTICS, 2002, 71 (02) : P80 - P80
  • [23] OPTIMAL SAMPLING STRATEGIES FOR WEIGHTED LINEAR-REGRESSION ESTIMATION
    SCHREUDER, HT
    OUYANG, Z
    CANADIAN JOURNAL OF FOREST RESEARCH-REVUE CANADIENNE DE RECHERCHE FORESTIERE, 1992, 22 (02): : 239 - 247
  • [24] ON OPTIMAL CHOICE OF SAMPLING STRATEGIES FOR LINEAR-SYSTEM IDENTIFICATION
    NG, TS
    GOODWIN, GC
    INTERNATIONAL JOURNAL OF CONTROL, 1976, 23 (04) : 459 - 475
  • [25] Optimal sampling strategies for sub-100 nm overlay
    Rangarajan, B
    Templeton, M
    Capodieci, L
    Subramanian, R
    Scranton, A
    METROLOGY, INSPECTION, AND PROCESS CONTROL FOR MICROLITHOGRAPHY XII, 1998, 3332 : 348 - 359
  • [26] Adaptive Graph Signal Processing: Algorithms and Optimal Sampling Strategies
    Di Lorenzo, Paolo
    Banelli, Paolo
    Isufi, Elvin
    Barbarossa, Sergio
    Leus, Geert
    IEEE TRANSACTIONS ON SIGNAL PROCESSING, 2018, 66 (13) : 3584 - 3598
  • [27] FREEHAND TRANSPERINEAL BIOPSY SAMPLING STRATEGIES: WHAT IS THE OPTIMAL TEMPLATE?
    Dupati, Ajith
    Qi, Ji
    DiBianco, John M.
    Ferrante, Stephanie
    Cole, Adam
    Walker, Adam
    Wei, John T.
    Ellimoottil, Chandy
    Herrel, Lindsey A.
    Wu, Richard C.
    Stork, Brian R.
    George, Arvin K.
    JOURNAL OF UROLOGY, 2021, 206 : E783 - E783
  • [28] Sampling from Correlated Populations: Optimal Strategies and Comparison Study
    Papageorgiou I.
    Sankhya B, 2016, 78 (1) : 119 - 151
  • [29] QUICKSORT
    HOARE, CAR
    COMPUTER JOURNAL, 1962, 5 (01): : 10 - &
  • [30] Optimal sampling and limited sampling strategies for estimation of unbound platinum AUC after nedaplatin infusion
    Ishibashi, T
    Fukumura, K
    Yano, Y
    Oguma, T
    ANTICANCER RESEARCH, 2005, 25 (2B) : 1283 - 1289