It depends "highly" on the language used doesn't it?

Based on the problem as stated....
I'd assume no prior knowledge of the rotation amount or direction.
Unless the array is known/assumed to be very large,  the simplest
solution is likely the best.  Anything else may not qualify under the
"elegant" requirement.

Here's a simple Fortran solution:

given:
an integer array  a(n) with n elements in it
an integer scalar variable,  smallest_a,  to store the result in

:::  sorting, rotating, etc., etc. :::

Finding the minimum value is just a one-liner:

  smallest_a = MINVAL( a, dim=1 )

Dan  :-)

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to