java - Unique Random Integer Generator -


i'm trying make random integer generator produces unique numbers.

does has ideas how's possible?

if have small-enough range of possible numbers, simple , useful:

final list<integer> sack = new arraylist<>(range); (int = 0; < range; i++) sack.add(i); collections.shuffle(sack); 

now pull items out of sack in order.


Comments

Popular posts from this blog

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

ruby on rails - Authlogic - how to make a registration and don't log in the new account? -