ScienceDirect® Home Skip Main Navigation Links
You have guest access to ScienceDirect. Find out more.
 
Home
Browse
My Settings
Alerts
Help
 Quick Search
 Search tips (Opens new window)
    Clear all fields    
advertisementadvertisement
Journal of Algorithms
Volume 51, Issue 2, May 2004, Pages 170-184
 
Font Size: Decrease Font Size  Increase Font Size
 Abstract - selected
Purchase PDF (228 K)

 
 
 
Related Articles in ScienceDirect
View More Related Articles
 
View Record in Scopus
 
doi:10.1016/j.jalgor.2004.01.003    How to Cite or Link Using DOI (Opens New Window)
Copyright © 2004 Elsevier Inc. All rights reserved.

Permuting in place: analysis of two stopping rules

Alois PanholzerE-mail The Corresponding Author, a, 1, Helmut ProdingerCorresponding Author Contact Information, E-mail The Corresponding Author, b, 2 and Marko RiedelE-mail The Corresponding Author, c

a Institut für Algebra und Computermathematik, TU Wien, Wiedner Hauptstr. 8-10, 1040, Wien, Austria b The John Knopfmacher Centre for Applicable Analysis and Number Theory, School of Mathematics, University of the Witwatersrand, P.O. Wits, 2050, Johannesburg, South Africa c EDV, Neue Arbeit gGmbH, Presselstr. 29, 70191, Stuttgart, Germany

Received 2 September 2002. 
Available online 16 March 2004.

Purchase the full-text article



References and further reading may be available for this article. To view references and further reading you must purchase this article.

Abstract

Permuting in place has been first analyzed by Knuth. It uses the cycle structure of the permutation. The elements of an array to be permuted are only moved when one sees a cycle leader (smallest element in its cycle). So the essential part of such an algorithm is to test an element i about whether it is a cycle leader.

Recently, Keller [Inform. Process. Lett. 81 (2002) 119–125] introduced two stopping rules: “If the last cycle leader has been detected, all elements have been moved, and no further tests are necessary” (heuristic 1), respectively “If only r elements have not been moved, then proceeding along a cycle is only useful for r steps” (heuristic 2).

We analyze the average costs of these modifications applied to the standard algorithm of Knuth; they are (n+2)Hn−5n/2−1/2not, vert, similarnlogn and respectively ((2n+1)/4)Hleft floor(n+1)/2right floor+(1/2)H2left floor(n+1)/2right floor−(1/2)(left floor(n+1)/2right floorleft floorn/2right floor)−(n+1)/2not, vert, similar(n/2)logn, as opposed to (n+1)Hn−2nnot, vert, similarnlogn in the classical case.

Author Keywords: Analysis of algorithms; Permuting in place; Knuth's parameter a; Harmonic numbers

Article Outline

• References

Journal of Algorithms
Volume 51, Issue 2, May 2004, Pages 170-184
 
Home
Browse
My Settings
Alerts
Help
Elsevier.com (Opens new window)
About ScienceDirect  |  Contact Us  |  Information for Advertisers  |  Terms & Conditions  |  Privacy Policy
Copyright © 2008 Elsevier B.V. All rights reserved. ScienceDirect® is a registered trademark of Elsevier B.V.