Skip to main content

A Randomized In-Place Algorithm for Positioning the kth Element in a Multiset

  • Conference paper
  • First Online:
  • 686 Accesses

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

Abstract

A variant of the classical selection problem, called the positioning problem, is considered. In this problem we are given a sequence A[1:n] of size n, an integer k, 1 ≤ kn, and an ordering function ⧀, and the task is to rearrange the elements of the sequence such that A[k] ⧀ A[j] is false for all j, 1 ≤ j < k, and A[l] ⧀ A[k] is false for all l, k < ln. We present a Las-Vegas algorithm which carries out this rearrangement efficiently using only a constant amount of additional space even if the input contains equal elements and if only pairwise element comparisons are permitted. To be more precise, the algorithm solves the positioning problem in-place in linear time using at most n + k + o(n) element comparisons, k + o(n) element exchanges, and the probability for succeeding within stated time bounds is at least 1 - e -n Ω(1)

Partially supported by Danish Natural Science Research Council under contract 9701414 (project Experimental Algorithmics) and contract 9801749 (project Performance Engineering).

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. M. Blum, R. W. Floyd, V. Pratt, R. L. Rivest, AND R. E. Tarjan, Time bounds for selection, Journal of Computer and System Sciences 7 (1973), 448–461.

    Article  MATH  MathSciNet  Google Scholar 

  2. S. Carlsson AND M. Sundström, Linear-time in-place selection in less than 3n comparisons, Proceedings of the 6th International Symposium on Algorithms and Computation, Lecture Notes in Computer Science 1004, Springer-Verlag, Berlin/Heidelberg (1995), 244–253.

    Google Scholar 

  3. W. Cunto AND J. I. Munro, Average case selection, Journal of the ACM 36 (1989), 270–279.

    Article  MATH  MathSciNet  Google Scholar 

  4. R. W. Floyd AND R. L. Rivest, Expected time bounds for selection, Communications of the ACM 18 (1975), 165–172.

    Article  MATH  Google Scholar 

  5. V. Geffert, Linear-time in-place selection in ɛ · n element moves, Unpublished typescript (2000).

    Google Scholar 

  6. V. Geffert, J. Katajainen, AND T. Pasanen, Asymptotically efficient in-place merging, Theoretical Computer Science 237 (2000), 159–181.

    Article  MATH  MathSciNet  Google Scholar 

  7. C. A. R. Hoare, Algorithm 65: Find, Communications of the ACM 4 (1961), 321–322.

    Article  Google Scholar 

  8. J. Katajainen AND T. Pasanen, Stable minimum space partitioning in linear time, BIT 32 (1992), 580–585.

    Article  MATH  MathSciNet  Google Scholar 

  9. J. Katajainen AND T. Pasanen, Sorting multiset stably in minimum space, Acta Informatica 31 (1994), 301–313.

    Article  MATH  MathSciNet  Google Scholar 

  10. J. Katajainen, T. Pasanen, AND J. Teuhola, Practical in-place mergesort, Nordic Journal of Computing 3 (1996), 27–40.

    MathSciNet  Google Scholar 

  11. J. Katajainen AND T. A. Pasanen, In-place sorting with fewer moves, Information Processing Letters 70 (1999), 31–37.

    Article  MATH  MathSciNet  Google Scholar 

  12. P. Kirschenhofer, H. Prodinger, AND C. Martínez, Analysis of Hoare’s Find algorithm with median-of-three partition, Random Structures and Algorithms 10 (1997), 143–156.

    Article  MATH  MathSciNet  Google Scholar 

  13. T. W. Lai AND D. Wood, Implicit selection, Proceedings of the 1st Scandinavian Workshop on Algorithm Theory, Lecture Notes in Computer Science 318, Springer-Verlag, Berlin/Heidelberg (1988), 14–23.

    Google Scholar 

  14. C. Levcopoulos AND O. Petersson, Exploiting few inversions when sorting: Sequential and parallel algorithms, Theoretical Computer Science 163 (1996), 211–238.

    Article  MATH  MathSciNet  Google Scholar 

  15. R. Motwani AND P. Raghavan, Randomized Algorithms, Cambridge University Press, Cambridge (1995).

    MATH  Google Scholar 

  16. J. I. Munro, An implicit data structure supporting insertion, deletion, and search in o(log2 n) time, Journal of Computer and System Sciences 33 (1986), 66–74.

    Article  MATH  MathSciNet  Google Scholar 

  17. J. T. Postamus, A. H. G. Rinnooy Kan, AND G. T. Timmer, An efficient dynamic selection method, Communications of the ACM 26 (1983), 878–881.

    Article  Google Scholar 

  18. A. Schönhage, M. S. Paterson, AND N. Pippenger, Finding the median, Journal of Computer and System Sciences 13 (1976), 184–199.

    MATH  MathSciNet  Google Scholar 

  19. R. Sedgewick, The analysis of Quicksort programs, Acta Informatica 7 (1977), 327–355.

    Article  MATH  MathSciNet  Google Scholar 

  20. J.W.J. Williams, Algorithm 232: Heapsort, Communications of the ACM 7 (1964), 347–348.

    Google Scholar 

  21. L. Yde, Performance engineering the nth element function, CPH STL Report 2002-4, Department of Computing, University of Copenhagen, Copenhagen (2002). Available at http://www.cphstl.dk.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Katajainen, J., Pasanen, T.A. (2002). A Randomized In-Place Algorithm for Positioning the kth Element in a Multiset. In: Penttonen, M., Schmidt, E.M. (eds) Algorithm Theory — SWAT 2002. SWAT 2002. Lecture Notes in Computer Science, vol 2368. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45471-3_42

Download citation

  • DOI: https://doi.org/10.1007/3-540-45471-3_42

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43866-3

  • Online ISBN: 978-3-540-45471-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics