Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: random number

by I0 (Priest)
on Dec 14, 2002 at 23:35 UTC ( #219912=note: print w/replies, xml ) Need Help??


in reply to Re: Re: random number
in thread random number

#splice is still O(n) $array[$index] = $array[-1]; pop @array;

Replies are listed 'Best First'.
Re: Re: Re: Re: random number
by BrowserUk (Pope) on Dec 15, 2002 at 00:19 UTC

    True. And that's a neat solution.

    It would still be better to shuffle the array and simply pop the next one when you need it as was suggested at near the top of the thread.


    Examine what is said, not who speaks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://219912]
help
Chatterbox?
[choroba]: erix Reminds me of people selling second hand clothes made by the famous "Keep Away From Fire" brand

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-01-16 16:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (151 votes). Check out past polls.