Jon Bentley in Programming Pearls Column 2 describes what has came to be known as the most elegant, efficient solution. The rotation algorithm uses a function reverse() that reverses subsequences of the array. Quoting from the column: Let's view the problem as transforming the array ab into the array ba, but let's also assume that we have a function that reverses the elements in a specified port..