Randomize shuffle the contents of the array after you


In java, to meet the following requirements, what I should do?

1) Half the data is 0s, half 1s.

2) Half the data is 0s, half the remainder is 1s, half the reminder is 2s, and so forth.

3) Half the data is 0s, half random int values (can use nextInt() from Java's Random package)

4) Each of these three techniques should be implemented as a static method that takes a integer representing the size of a dataset, and returns an integer array containing that number of elements generated with the corresponding rule. Randomize (shuffle) the contents of the array after you populate it.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Randomize shuffle the contents of the array after you
Reference No:- TGS02666012

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)