Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

RE: RE (tilly) 2 (one is worse): Re: Randomize an array

by Adam (Vicar)
on Sep 08, 2000 at 03:34 UTC ( #31515=note: print w/replies, xml ) Need Help??


in reply to RE (tilly) 2 (one is worse): Re: Randomize an array
in thread Randomize an array

I really should have paid more attention in Algorithm's analysis. Sigh. Maybe I'll take the next level of it when I go back to grad school. You are right. Sort is an implementation of QuickSort ( O(n log n) using lots of memory) while Fisher-Yates is O(n) with a constant defined only by how long it takes to do the rand and the swap. (We had that discussion already. <grin>) So this makes sense. And of course, this defends my suggestion that Fisher-Yates is preferable to the one-liner. Thanks tilly, maybe one day my education will start to sink in.
  • Comment on RE: RE (tilly) 2 (one is worse): Re: Randomize an array

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2019-05-21 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (135 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!