Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Fastest way to sort a list of integers into 0,1,2,3,-3,-2,-1

by trippledubs (Deacon)
on Feb 06, 2019 at 21:46 UTC ( #1229500=note: print w/replies, xml ) Need Help??


in reply to Fastest way to sort a list of integers into 0,1,2,3,-3,-2,-1

Well, tried :)
td => sub { my $q = POE::Queue::Array->new; for (@input) { $_ == 0 && $q->enqueue(-1000,$_)&& next; $q->enqueue(-1/$_,$_); } my @out; while (my @l = $q->dequeue_next()) { push @out,$l[2]; } Compare(\@out,\@output) or die "@out" if DO_CHECK; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1229500]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2020-10-30 19:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (284 votes). Check out past polls.

    Notices?