in reply to Re^2: rand + shift || pop
in thread rand + shift || pop
Shuffleing is O(n) and spliceing is O(1), this may matter if your array is large.
Update: Oops, my understanding of splice was wrong. See JavaFan and ikegami below.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: rand + shift || pop
by JavaFan (Canon) on Dec 21, 2010 at 16:41 UTC | |
Re^4: rand + shift || pop
by ikegami (Patriarch) on Dec 21, 2010 at 17:21 UTC |
In Section
Seekers of Perl Wisdom