A simple insertion sort fits your criteria; although, it runs in O(n^2).
Jeremy
---------------------------------
#!/usr/bin/perl
s ees\e,\e my e,y{,s })rj)d,print
-----Original Message-----
From: artist google [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 3:42 PM
To: [EMAIL PROTECTED]
Subject: Re: sort numbers
Well,
I am not looking for randomly achieved solutions.
and looking for minimum steps to achieve solution.
I thought that was obvious.
Artist.
--- Philip Newton wrote
> On 01 Jan 2003 21:54:25 -
> (Randal L.
> Schwartz) wrote:
>
> > >>>>> "Philip" == Philip Newton
> >
> > Philip> You're not allowed to compare numbers?
> That will make it difficult to
> > Philip> find out when the list is sorted.
> >
> > use ESP::Psychic qw(infer_sortedness);
>
> Ah! Easy, then.
>
>
> use ESP::Psychic qw(infer_sortedness);
>
> sub bogosort {
> do {
> rotate_sequential (start => rand($#_ - 3));
> } while(! infer_sortedness);
> }
>
>
> Cheers,
> Philip
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com