Select-Random.ps1 is ineffective for large input

Topics: Developer Forum
Jun 22, 2007 at 1:46 PM
Doing operation += for arrays is extremely slow for large number of items.

Besides, there is a well known tiny, elegant and effective algorithm not collecting input in memory at all; one implementation is here: http://nightroman.spaces.live.com/blog/cns!F011223B604739FA!122.entry.

Please, feel free to use it (changed or not) if you like it.

Thanks,
Roman Kuzmin
Jun 22, 2007 at 1:50 PM
Do not include trailing dot in the link above, i.e. the correct link is:
http://nightroman.spaces.live.com/blog/cns!F011223B604739FA!122.entry
Coordinator
Jun 22, 2007 at 4:01 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Jun 22, 2007 at 4:02 PM
Thanks for the feedback!