UNB/ CS/ David Bremner/ teaching/ old/ cs1083/ java/ MyMergeSort2.java
import java.util.Arrays;
public class MyMergeSort2 extends MyMergeSort {
    public static void sort(int[] a){
        if (a.length <= 1) return;
        if (a.length <= 26){
            IntSelectionSort.sort(a);
        } else {
            int mid=a.length/2;
            int[] left=Arrays.copyOfRange(a,0,mid);
            int[] right=Arrays.copyOfRange(a,mid,
                                     a.length);
            sort(left); sort(right);
            merge(left,right,a);
        }
    }
    public static void main(String[] args){
        int [] data= ArrayUtil.randomIntArray(10,1000);

        ArrayUtil.print(data);

        sort(data);

        ArrayUtil.print(data);
    }

}