skip to main content
research-article

Randomized Shellsort: A Simple Data-Oblivious Sorting Algorithm

Published: 01 December 2011 Publication History

Abstract

In this article, we describe a randomized Shellsort algorithm. This algorithm is a simple, randomized, data-oblivious version of the Shellsort algorithm that always runs in O(n log n) time and succeeds in sorting any given input permutation with very high probability. Taken together, these properties imply applications in the design of new efficient privacy-preserving computations based on the secure multiparty computation (SMC) paradigm. In addition, by a trivial conversion of this Monte Carlo algorithm to its Las Vegas equivalent, one gets the first version of Shellsort with a running time that is provably O(n log n) with very high probability.

References

[1]
Ajtai, M., Komlós, J., and Szemerédi, E. 1983. Sorting in c log n parallel steps. Combinatorica 3, 1--19.
[2]
Arora, S., Leighton, T., and Maggs, B. 1990. On-line algorithms for path selection in a nonblocking network. In Proceedings of the 22nd ACM Symposium on Theory of Computing (STOC’90). ACM, New York, 149--158.
[3]
Assaf, S. and Upfal, E. 1991. Fault tolerant sorting networks. SIAM J. Disc. Math. 4, 4, 472--480.
[4]
Atallah, M. J., Frederickson, G. N., and Kosaraju, S. R. 1988. Sorting with efficient use of special-purpose sorters. Inf. Process. Lett. 27, 1, 13--15.
[5]
Beigel, R. and Gill, J. 1990. Sorting n objects with a k-sorter. IEEE Trans. Comput. 39, 714--716.
[6]
Ben-David, A., Nisan, N., and Pinkas, B. 2008. FairplayMP: A system for secure multi-party computation. In Proceedings of the 15th ACM Conference on Computer and Communications Security (CCS’08). ACM, New York, 257--266.
[7]
Blackston, D. T. and Ranade, A. 1993. Snakesort: A family of simple optimal randomized sorting algorithms. In Proceedings of the International Conference on Parallel Processing (ICPP’93). IEEE Computer Society, Los Alamitos, CA, 201--204.
[8]
Braverman, M. and Mossel, E. 2008. Noisy sorting without resampling. In Proceedings of the 19th ACM-SIAM Symposium on Discrete Algorithms (SODA’08). SIAM, Philadelphia, PA, 268--276.
[9]
Brejová, B. 2001. Analyzing variants of Shellsort. Inf. Proc. Lett. 79, 5, 223--227.
[10]
Canetti, R., Lindell, Y., Ostrovsky, R., and Sahai, A. 2002. Universally composable two-party and multi-party secure computation. In Proceedings of the 34th Annual ACM Symposium on Theory of Computing (STOC’02). ACM, New York, 494--503.
[11]
Cole, R. 1988. Parallel merge sort. SIAM J. Comput. 17, 4, 770--785.
[12]
Cormen, T. H., Leiserson, C. E., Rivest, R. L., and Stein, C. 2001. Introduction to Algorithms 2nd Ed. MIT Press, Cambridge, MA.
[13]
Cypher, R. 1993. A lower bound on the size of Shellsort sorting networks. SIAM J. Comput. 22, 1, 62--71.
[14]
Dobosiewicz, W. 1980. An efficient variation of bubble sort. Inf. Process. Lett. 11, 1, 5--6.
[15]
Du, W. and Atallah, M. J. 2001. Secure multi-party computation problems and their applications: A review and open problems. In Proceedings of the Workshop on New Security Paradigms (NSPW’01). ACM, New York, 13--22.
[16]
Du, W. and Zhan, Z. 2002. A practical approach to solve secure multi-party computation problems. In Proceedings of the Workshop on New Security Paradigms (NSPW’02). ACM, New York, 127--135.
[17]
Feige, U., Raghavan, P., Peleg, D., and Upfal, E. 1994. Computing with noisy information. SIAM J. Comput. 23, 5, 1001--1018.
[18]
Franceschini, G., Muthukrishnan, S., and Pătraşcu, M. 2007. Radix sorting with no extra space. In Proceedings of the European Symposium on Algorithms (ESA). 194--205.
[19]
Goodrich, M. T. 2009. The mastermind attack on genomic data. In Proceedings of the IEEE Symposium on Security and Privacy. IEEE, 204--218.
[20]
Goodrich, M. T. and Kosaraju, S. R. 1996. Sorting on a parallel pointer machine with applications to set expression evaluation. J. ACM 43, 2, 331--361.
[21]
Goodrich, M. T. and Tamassia, R. 2002. Algorithm Design: Foundations, Analysis, and Internet Examples. Wiley, New York.
[22]
Hoeffding, W. 1963. Probability inequalities for sums of bounded random variables. J. AMS Statistical Association 58, 301, 13--30.
[23]
Incerpi, J. and Sedgewick, R. 1985. Improved upper bounds on Shellsort. J. Comput. Syst. Sci. 31, 2, 210--224.
[24]
Incerpi, J. and Sedgewick, R. 1987. Practical variations of Shellsort. Inf. Process. Lett. 26, 1, 37--43.
[25]
Jiang, T., Li, M., and Vitányi, P. 2000. A lower bound on the average-case complexity of Shellsort. J. ACM 47, 5, 905--911.
[26]
Knuth, D. E. 1973. Sorting and Searching. The Art of Computer Programming, vol. 3. Addison-Wesley, Reading, MA.
[27]
Leighton, F. T. 1992. Introduction to Parallel Algorithms and Architectures: Arrays, Trees, Hypercubes. Morgan-Kaufmann, San Francisco, CA.
[28]
Leighton, T. 1985. Tight bounds on the complexity of parallel sorting. IEEE Trans. Comput. 34, 4, 344--354.
[29]
Leighton, T. and Plaxton, C. G. 1998. Hypercubic sorting networks. SIAM J. Comput. 27, 1, 1--47.
[30]
Maggs, B. M. and Vöcking, B. 2000. Improved routing and sorting on multibutterflies. Algorithmica 28, 4, 438--437.
[31]
Malkhi, D., Nisan, N., Pinkas, B., and Sella, Y. 2004. Fairplay---A secure two-party computation system. In Proceedings of the 13th Conference on USENIX Security Symposium (SSYM’04). USENIX Association, Berkeley, CA, 20--20.
[32]
Maurer, U. 2006. Secure multi-party computation made simple. Disc. Appl. Math. 154, 2, 370--381.
[33]
McGeoch, C., Sanders, P., Fleischer, R., Cohen, P. R., and Precup, D. 2002. Using finite experiments to study asymptotic performance. In Experimental algorithmics: From Algorithm Design to Robust and Efficient Software. Springer-Verlag, Berlin, Germany, 93--126.
[34]
Mitzenmacher, M. and Upfal, E. 2005. Probability and Computing: Randomized Algorithms and Probabilistic Analysis. Cambridge University Press, Cambridge, UK.
[35]
Motwani, R. and Raghavan, P. 1995. Randomized Algorithms. Cambridge University Press, Cambridge, UK.
[36]
Paterson, M. 1990. Improved sorting networks with O(log N) depth. Algorithmica 5, 1, 75--92.
[37]
Plaxton, C. G. and Suel, T. 1997. Lower bounds for Shellsort. J. Algorithms 23, 2, 221--240.
[38]
Pratt, V. R. 1972. Shellsort and sorting networks. Ph.D. thesis, Stanford University, Palo Alto, CA.
[39]
Rajasekaran, S. and Sen, S. 2005. PDM sorting algorithms that take a small number of passes. In Proceedings of the 19th IEEE International Parallel and Distributed Processing Symposium (IPDPS’05) (Papers). IEEE Computer Society, Los Alamitos, CA, 10.
[40]
Reif, J. H. 1985. An optimal parallel algorithm for integer sorting. In Proceedings of the 26th Annual Symposium on Foundations of Computer Science (SFCS’85). IEEE Computer Society, Los Alamitos, CA, 496--504.
[41]
Sanders, P. and Fleischer, R. 2001. Asymptotic complexity from experiments? A case study for randomized algorithms. In Proceedings of the 4th International Workshop on Algorithm Engineering (WAE’00). Springer-Verlag, Berlin, Germany, 135--146.
[42]
Scherson, I. D. and Sen, S. 1989. Parallel sorting in two-dimensional VLSI models of computation. IEEE Trans. Comput. 38, 2, 238--249.
[43]
Sedgewick, R. 1992. Algorithms in C++. Addison-Wesley, Reading, MA.
[44]
Sedgewick, R. 1996. Analysis of Shellsort and related algorithms. In Proceedings of the 4th Annual European Symposium on Algorithms (ESA’96). Springer-Verlag, Berlin, Germany, 1--11.
[45]
Seiferas, J. 2009. Sorting networks of logarithmic depth, further simplified. Algorithmica 53, 3, 374--384.
[46]
Shavit, N., Upfal, E., and Zemach, A. 1997. A wait-free sorting algorithm. In Proceedings of the ACM Symposium on Principles of Distributed Computing (PODC). ACM, 121--128.
[47]
Shell, D. L. 1959. A high-speed sorting procedure. Comm. ACM 2, 7, 30--32.
[48]
Weiss, M. A. and Sedgewick, R. 1988. Bad cases for shaker-sort. Inf. Proc. Lett. 28, 3, 133--136.

Cited By

View all

Index Terms

  1. Randomized Shellsort: A Simple Data-Oblivious Sorting Algorithm

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image Journal of the ACM
    Journal of the ACM  Volume 58, Issue 6
    December 2011
    209 pages
    ISSN:0004-5411
    EISSN:1557-735X
    DOI:10.1145/2049697
    Issue’s Table of Contents
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 01 December 2011
    Accepted: 01 August 2011
    Revised: 01 June 2011
    Received: 01 January 2010
    Published in JACM Volume 58, Issue 6

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Chernoff bounds
    2. Sorting
    3. data-oblivious algorithms

    Qualifiers

    • Research-article
    • Research
    • Refereed

    Funding Sources

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)49
    • Downloads (Last 6 weeks)3
    Reflects downloads up to 29 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    Full Access

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media