import java.util.Random; /** * A simple class to generate random integer arrays, * often quite useful for testing sorting algorithms. * *
* Written as an example for an ACM Crossroads article
* about using
* This is a trivial method written just to demonstrate how a
* comment is written for Javadoc. Notice the special tags:
*
* @since 0.1
*
* @param size the size of the array to create
* (the number of values to generate)
* @param min the least value that may be generated
* @param max the greatest value that may be generated
*
* @return an array of javadoc, the Java API
* documentation generator of HTML pages.
*
* @author Kevin Henry size primitive int
* values between the min and
* max range, inclusive
*/
public int [] generateRandomIntArray (int size, int min, int max)
{
Random generate = new Random ();
int [] array = new int [size];
for (int index = 0; index < size; index++)
array [index] = generate.nextInt (max - min + 1) + min;
return array;
}
}