Question
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,
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started