I want to create 10 random numbers in the range 0-500. But the problem is that I want those numbers to be unique. For 2 random numbers i could create something as the follow
Make a LinkedList of the numbers from 1-500 and shuffle one out of them each time you use a number using The Fisher-Yates shuffle.
LinkedList
This will give you guaranteed sane (constant time) performance for each number pulled.