http://qs1969.pair.com?node_id=388542


in reply to Re: How to generate different random numbers?
in thread How to generate distinct random numbers?

No he doesn't. What he's actually asking for is a random shuffle. There are well known O(n) time and memory algorithms for that sort of thing. Look up Fischer-Yates.

update: of course a shuffle won't work so well if the range is large