import java.util.*; public class Tester { public static void main(String [] args) { // Create a "perm" object. The Perm constructor takes an integer // as a parameter, indicating how big you want your arrays. Let's // try 6. You can use the toString() method to obtain the object's // string representation. // Then we are going to need a loop... // For each line in the perm string, create an array object // A couple interesting things -- using \n as delimiter, and // passing a string containing ints to constructor that makes array // To make things a little easier for that constructor, let's tell // it how many numbers to expect. Thus, we want to call the specific // Array constructor that takes an int and a string, as in: // Array a = new Array(6, line); // I've provided you with variables that keep track of the total // operations per sorting method. int totalSwapOps = 0, totalSelectionOps = 0, totalInsertionOps = 0, totalBubbleOps = 0, totalMergeOps = 0, totalQuickOps = 0; System.out.println("Total swap operations = " + totalSwapOps); System.out.println("Total selection operations = " + totalSelectionOps); System.out.println("Total insertion operations = " + totalInsertionOps); System.out.println("Total bubble operations = " + totalBubbleOps); System.out.println("Total merge operations = " + totalMergeOps); System.out.println("Total quick operations = " + totalQuickOps); } }