Skip Navigation

The Computer Journal 1997 40(9):541-546; doi:10.1093/comjnl/40.9.541
© 1997 by British Computer Society
This Article
Right arrow Full Text (PDF)
Right arrow Alert me when this article is cited
Right arrow Alert me if a correction is posted
Services
Right arrow Email this article to a friend
Right arrow Similar articles in this journal
Right arrow Alert me to new issues of the journal
Right arrow Add to My Personal Archive
Right arrow Download to citation manager
Right arrowRequest Permissions
Google Scholar
Right arrow Articles by Shene, C.-K.
Right arrow Search for Related Content
Social Bookmarking
 Add to CiteULike   Add to Connotea   Add to Del.icio.us  
What's this?

An Analysis of Two In-Place Array Rotation Algorithms

C.-K. Shene

Department of Computer Science, Michigan Technological University, Houghton, MI 49931-1295, USA Email: shene{at}mtu.edu

This paper presents a complexity analysis of two STL in-place rotation algorithms. If an array of n elements is rotated to the right {Delta} positions, the first STL version, which uses forward iterators, used n – gcd(n, {Delta}) swaps, while the second version, which uses random access iterators, uses only n+gcd(n, {Delta}) array elements movements. This paper also proves the optimality of the second version. A performance comparison is included.


Received January 20, 1997. revised January 16, 1998.


Add to CiteULike CiteULike   Add to Connotea Connotea   Add to Del.icio.us Del.icio.us    What's this?




Disclaimer:
Please note that abstracts for content published before 1996 were created through digital scanning and may therefore not exactly replicate the text of the original print issues. All efforts have been made to ensure accuracy, but the Publisher will not be held responsible for any remaining inaccuracies. If you require any further clarification, please contact our Customer Services Department.