 /*****************************************************************
 * Lab 7: ArrayUtils
 * Programmer: Insert your name
 * 
 * Due Date: Insert due date
 * Class: COMP 110-01         Instructor: Tyler Johnson
 *         
 * Pledge: I have neither given nor received unauthorized aid
 * on this program.     (signature on file)
 *
 * Description: The ArrayUtils class defines several static functions
 *				that can be used to perform useful operations on arrays.
 *
 * Input: N/A
 *
 * Output: N/A
 *
 ******************************************************************/

public class ArrayUtils {

	/* The following method is a convenience method for you.  It will make
	 * it easier to print the contents of an array when you are testing methods
	 */

	public static String toString(int[] array) {
	
		if(array.length < 1) {
			// Array is 0 sized so return just "{}"
			return "{}";
		}

		String s = "{";  // opening brace
		
		for (int i = 0; i < array.length - 1; i++) {
			s = s + array[i] + ", "; // for each element from first to second-to-last, concatenate the element and a ','
		}
		
		return s + array[array.length - 1] + "}"; // concatenate the last element (with no ',') and concatenate a closing brace
	}
	
	public static boolean equals(int [] a1, int [] a2) {
		// The following line is here just to get the program to compile.
		// You should replace it
		return true; // replace this code
	}

	public static int[] expand(int[] array) {
		// The following line is here just to get the program to compile.
		// You should replace it
		return new int[0];  // replace this line
	}

	public static boolean isSorted(int[] array) {
		// The following line is here just to get the program to compile.
		// You should replace it
		return true; // replace this code
	}

	public static int[] reverse(int[] a) {
		// The following line is here just to get the program to compile.
		// You should replace it
		return new int[0]; // replace this code
	}

	public static int[] wheel(int[] array, int offset) {
		// The following line is here just to get the program to compile.
		// You should replace it
		return new int[0]; // replace this code
	}

	public static void main(String args[]) {
		// The following code is there to test 'expand'.  You can change it.
		int[] test = {0, 2, 1};

		int[] testExpand = expand(test);
		String s = toString(testExpand);
		System.out.println(s);
	}
}
