Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: Randomly select values from array

by BrowserUk (Patriarch)
on May 16, 2010 at 19:11 UTC ( [id://840250]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Randomly select values from array
in thread Randomly select values from array

But why combine an O( N! ) algorithm with an O(N log N) algorithm, when Fischer-Yates is O(N)?

List::Util::shuffle() does a million 4 way shuffles in less than 1 second.

Replies are listed 'Best First'.
Re^5: Randomly select values from array
by blakew (Monk) on May 16, 2010 at 19:37 UTC
    I was shooting for humorous understatement, guess it wasn't obvious enough. I agree it's a horrible idea to actually use, I was just practicing to see why the original sort version doesn't work for myself.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2025-07-11 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.