Question: Please code in java /** * Just a container, really, that serves as a place to house these public * methods: * * static Integer[]
Please code in java
/**
* Just a container, really, that serves as a place to house these public
* methods:
*
* static Integer[] selectSort( Integer[] incoming );
*
* static Integer[] selectSortReverse( Integer[] incoming );
*
* static int findMin( int fromIndex, Integer[] arrayOfInts );
*
* static int findMax( int fromIndex, Integer[] arrayOfInts );
*
* static void swap( int fromPos, int toPos, Integer[] arrayOfInts);
*
* Note: these MUST be public in order for you to pass any of the tests.
*
*
*
*/
public class SelectionSorter {
/**
* Returns a sorted (from largest to smallest) copy of the incoming array of
* Integers.
*
* @param incoming
* @return
*/
public static Integer[] selectSortReverse(Integer[] incoming) {
throw new UnsupportedOperationException("you must implement this method");
}
/**
* Return the index of the smallest element in the arrayOfInts, beginning
* the search fromIndex;
*
* @param fromIndex
* @param arrayOfInts
* @return
*/
public static int findMin(int fromIndex, Integer[] arrayOfInts) {
throw new UnsupportedOperationException("you must implement this method");
}
/**
* Returns the index of the largest element in the arrayOfIntegers,
* beginning from the fromIndex.
*
* @param fromIndex
* @param arrayOfIntegers
* @return
*/
public static int findMax(int fromIndex, Integer[] arrayOfIntegers) {
throw new UnsupportedOperationException("you must implement this method");
}
/**
* Swaps the contents in the toPos with the fromPos; note, this method does
* not copy the array, but operates on the arrayOfInts directly.
*
* @param fromPos
* @param toPos
* @param arrayOfInts
*/
public static void swap(int fromPos, int toPos, Integer[] arrayOfInts) {
throw new UnsupportedOperationException("you must implement this method");
}
/**
* Performs the standard "insertion sort" on a shallow copy of the incoming
* array.
*
* @param incoming
* @return
*/
public static Integer[] insertionSort(Integer[] incoming) {
throw new UnsupportedOperationException("you must implement this method");
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
