import javax.swing.*; import java.util.*; /** * Three examples of sorting algorithms * insert sort, bubble sort and merge sort */ public class SortingAlgorithms { // The array to sort private int[] a; // A copy of the original array private int [] initialArray; // Default dimension of a private static final int SIZE=10; /** * Generate an array of random integers of size SIZE */ public SortingAlgorithms() { // Use the other constructor } /** * Generate an array of random integers of size n */ public SortingAlgorithms(int n) { // Take the default size if n <=0 // Create a // Fill a with random integers (between 0 and 999) // Initialize initialArray and make a copy of a in initialArray // (use System.arraycopy) } /** * write the array as a String * (toString is automatically called when using print * with a SortingAlgorithms) */ public String toString() { } /** * Sort the array with insert sort */ public void insertSort() { } /** * Precondition: a is ordered from 0 to i-1 * Postcondition: a is ordered from 0 to i */ private void insert(int i) { } /** * Sort the array with bubble sort */ public void bubbleSort() { } /** * Sort the array with merge sort (a faster algorithm) */ public void mergeSort() { } /** * Divide the array in two * Order each part * Merge the two ordered parts */ private void divideInTwo(int first, int last) { if (first