Skip to main content

On the average running time of odd-even merge sort

  • Conference paper
  • First Online:
STACS 95 (STACS 1995)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 900))

Included in the following conference series:

  • 940 Accesses

Abstract

This paper is concerned with the average running time of Batcher's odd-even merge sort when implemented on a collection of processors. We consider the case where the size n of the input is an arbitrary multiple of the number p of processors used. We show that Batcher's odd-even merge (for two sorted lists of length m each) can be implemented to run in time O((m/p)(1+log(1+p 2/m))) on the average, and that odd-even merge sort can be implemented to run in time O((n/p)(log(n/p)+logp(1+log(1+p 2/n)))) on the average. In the case of merging (sorting) the average is taken over all possible outcomes of the merging (all possible permutations of n elements). That means that odd-even merge and odd-even merge sort have an optimal average running time if np 2.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. K.E. Batcher. Sorting networks and their applications. Proceedings, AFIPS Spring Joint Computer Conference, 307–314, 1968.

    Google Scholar 

  2. D.T. Blackston, A. Ranade. SnakeSort: a family of simple optimal randomized sorting algorithms. Proc., Int. Conf. on Parallel Processing, Vol. III, 201–204, 1993.

    Google Scholar 

  3. G.E. Blelloch, L. Dagum, S.J. Smith, K. Thearling, M. Zagha. An evaluation of sorting as a supercomputer benchmark. Technical Report RNR-93-002, NAS Applied Research Branch, Jan. 1993.

    Google Scholar 

  4. G.E. Blelloch, C.E. Leiserson, B.M. Maggs, C.G. Plaxton, S.J. Smith, M. Zagha. A comparison of sorting algorithms for the Connection Machine CM-2. Proc., Symp. on Parallel Algorithms and Architectures, 3–16, 1991.

    Google Scholar 

  5. D. Culler, R. Karp, M. Patterson, A. Sahay, K.E. Schauser, E. Santos, R. Subramonian, T. von Eicken. LogP: Towards a Realistic Model of Parallel Computation. ACM SIGPLAN Symposium on Principles & Practice of Parallel Programming: PPOPP, 1993.

    Google Scholar 

  6. R. Diekmann, J. Gehring, R. Lülling, B. Monien, M. Nübel, R. Wanka. Sorting large data sets on a massively parallel system. Technical Report, Universität Paderborn.

    Google Scholar 

  7. W. Feller. An introduction to probability theory and its applications, Vol. 1. New Wiley series in probability and mathematical statistics, 1957, Wiley, New York.

    Google Scholar 

  8. R. Flajolet, L. Ramshaw. A note on gray code and odd-even merge. SIAM J. Comput., Vol. 9, 142–158, 1980.

    Google Scholar 

  9. W.L. Hightower, J.F. Prins, J.H. Reif. Implementations of randomized sorting on large parallel machines. Proc. Symp. on Parallel Processing, 158–167, 1992.

    Google Scholar 

  10. K. Hwang. Advanced Computer Architecture: Parallelism, Scalability, Programmability. McGraw-Hill, New York, 1993.

    Google Scholar 

  11. D.E. Knuth. The art of computer programming: Vol. 3/sorting and searching. Addison-Wesley series in computer science and information processing, 1973, Addison Wesley, Reading, Mass.

    Google Scholar 

  12. G. Larcher, R.F. Tichy. A note on gray code and odd-even merge. Discrete Applied Mathematics 18, 309–313, 1987.

    Google Scholar 

  13. D. Nassimi, Y.D. Tsai. An efficient implementation of Batcher's odd-even merge on a SIMD-hypercube. J. Parallel and Distributed Computing, Vol. 19, 58–63, 1993.

    Google Scholar 

  14. R. Sedgewick. Data movement in odd-even merging. SIAM J. Comput., Vol. 7, 239–272, 1978.

    Google Scholar 

  15. A. Tridgell, R. Brent. An implementation of a general-purpose parallel sorting algorithm. Technical Report TR-CS-93-01, Computer Sciences Laboratory, Australian National University, 1993.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Ernst W. Mayr Claude Puech

Rights and permissions

Reprints and permissions

Copyright information

© 1995 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Rüb, C. (1995). On the average running time of odd-even merge sort. In: Mayr, E.W., Puech, C. (eds) STACS 95. STACS 1995. Lecture Notes in Computer Science, vol 900. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-59042-0_99

Download citation

  • DOI: https://doi.org/10.1007/3-540-59042-0_99

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-59042-2

  • Online ISBN: 978-3-540-49175-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics