/** * Write a description of class Lab1App here. * * @author (your name) * @version (a version number or a date) */ public class Lab1App { // instance variable private static int[] listOfNumbers = {4, 2, 9, 1, 7, 6, 22, 11, 54, 32, 19, 27, 32}; /** * Application program. * Will print out a statistical analysis. */ public static void main(String[] args) { int[] result; printList(listOfNumbers); result = sortBySelection(listOfNumbers); System.out.print("Using selection, final result: "); printList(result); System.out.println(""); System.out.println(""); result = sortByInsertion(listOfNumbers); System.out.print("Using insertion, final result: "); printList(result); System.out.println(""); System.out.print("Original List: "); printList(listOfNumbers); System.out.println(""); }//=========================================== /** * Prints the list using a "for each" loop (Java 1.5 add-on) */ public static void printList(int[] theList) { for(int e : theList) System.out.print(e + " "); System.out.println(""); }//============================================================ /** * Sorts the list using the Selection Sort * I want you to PRINT THE LIST after each iteration * This will SHOW THE WAY THE ALGORITHM WORKS */ public static int[] sortBySelection(int[] theList) { // HINT: Keeps putting the max at the end return null; // change this }//=========================================================== /** * Sorts the list using the Insertion Sort * I want you to PRINT THE LIST after each iteration * This will SHOW THE WAY THE ALGORITHM WORKS */ public static int[] sortByInsertion(int[] theList) { // HINT: Puts things in the right place as you scan through the list // they may move more than once return null; // change this }//=========================================================== }