/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
{
// your code goes here
}
// *** Utility methods related to arrays ***
/**
* @param n is an int > 1
* @return a randomly generated int >= 0 and < n
*/
public static int getRandomInt(int n)
{
int a
= (int)(Math.
random() * n
); return a;
}
/**
* Purpose: use Arrays.toString to display array in standard form
* @param nums the array to display
*/
public static void displayArray(int[ ] nums)
{
}
/**
* Purpose: build an array filled with randomly generated ints
* @param len is the length of the array
* @param max the maximum size of the elements in the generated array
* @return an array containing len elements, all >= 0 and < max; use
* getRandomInt(max) to fill the elements in this array
*/
public static int[ ] buildArray(int len, int max)
{
// TODO: write this method
}
// *** Modify pattern method ***
/**
* Purpose: modify array to ensure that no entries are too large
* @param nums the array to modify
* @param limit an int > 2
* Postcondition: nums is modified by replacing all entries > limit with the
* value limit
*/
public static void setLimit(int[ ] nums, int limit)
{
// TODO: write this method
}
// *** Extract pattern method ***
/**
* @param nums is the source array
* @param start the position of the first entry in nums to be extracted
* @return an array containing, in original order, all the entries from nums
* at positions >= start
* Pre-condition start >= 0 and < nums.length
* Post condition: nums is not changed
*/
public static int[ ] getEnd(int[ ] nums, int start)
{
// TODO: write this method
}
}