lundi 16 février 2015

Generate random numbers without repeats

I want to generate random numbers without repeats till all gone, then again generating random numbers with the initial dataset.


I know keeping already generated numbers in an array and loopin through them to check whether it is alredy generated or the method deducting the numbers that are generated from the array and randomize numbers with the new array.


What I want is not those methods, if there is a way that is efficient using data structures will be quite nice, if it is any other method also ok


Thanks





Aucun commentaire:

Enregistrer un commentaire