Não precisa ser 100k não. Ponha apenas 60 elementos e dê-nos o resultado. :D
2011/5/19 Bruno Buss <bruno.b...@gmail.com> > Agora testa ai com 100k elementos :) > > > [ ]'s > > 2011/5/19 Renato Santos <renato.c...@gmail.com> > >> Me pareceu tão rapido... >> use Data::Dumper; >> use List::Util qw(shuffle); >> >> sub bogosort { >> my @a = @_; >> my @sorted = sort {$a <=> $b} @a; >> while("@a" ne "@sorted") { >> @a = shuffle(@a); >> } >> return @a; >> } >> >> @b = (4,56,8,5,2,5,6,4); >> renato@renato-desktop:/projetos/youdb/nestle/datamotion_ps$ time perl >> /tmp/xxx.pl2 >> $VAR1 = 2; >> $VAR2 = 4; >> $VAR3 = 4; >> $VAR4 = 5; >> $VAR5 = 5; >> $VAR6 = 6; >> $VAR7 = 8; >> $VAR8 = 56; >> >> real 0m0.058s >> user 0m0.052s >> sys 0m0.000s >> >> print Dumper bogosort(@b); >> >> 2011/5/19 Nelson Ferraz <nfer...@gmail.com> >> >>> 2011/5/19 Wesley Seidel <wesley.sei...@gmail.com> >>> > ahahaha >>> > Se levou tudo isso com um quicksort, imagine o tempo pra fazer essa >>> dança com um bubblesort. >>> >>> Imagina então um bogosort. :D >>> >>> http://en.wikipedia.org/wiki/Bogosort >>> =begin disclaimer >>> Sao Paulo Perl Mongers: http://sao-paulo.pm.org/ >>> SaoPaulo-pm mailing list: SaoPaulo-pm@pm.org >>> L<http://mail.pm.org/mailman/listinfo/saopaulo-pm> >>> =end disclaimer >>> >> >> >> >> -- >> Renato Santos >> http://www.renatocron.com/blog/ >> >> =begin disclaimer >> Sao Paulo Perl Mongers: http://sao-paulo.pm.org/ >> SaoPaulo-pm mailing list: SaoPaulo-pm@pm.org >> L<http://mail.pm.org/mailman/listinfo/saopaulo-pm> >> =end disclaimer >> >> > > > -- > Bruno C. Buss > http://brunobuss.wordpress.com/ > http://www.dcc.ufrj.br/~brunobuss/ > > =begin disclaimer > Sao Paulo Perl Mongers: http://sao-paulo.pm.org/ > SaoPaulo-pm mailing list: SaoPaulo-pm@pm.org > L<http://mail.pm.org/mailman/listinfo/saopaulo-pm> > =end disclaimer > > -- Wesley Seidel Carvalho 11-6671-6118 11-8169-1163 http://twitter.com/wseidel
=begin disclaimer Sao Paulo Perl Mongers: http://sao-paulo.pm.org/ SaoPaulo-pm mailing list: SaoPaulo-pm@pm.org L<http://mail.pm.org/mailman/listinfo/saopaulo-pm> =end disclaimer