I need to generate an random array from a bigger array of int without repetition and in a range of numbers.
For e.g
I have an array a[] with 1-200 int , What i need is random number array from all 200 int but of size 15.How could I implement this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That should do it. Random grab something from a. Once you’ve grabbed it, replace it with the “last” value of a. The “last” value is easily derived from a.length and i.