public void mergeSort (int[] array, int l, int u) {

        if (u-l < 1)
           return;
       
        if (u-l == 1) 
            insertionSort(array, l, u);

        int m = (l + u)/2, w = l + u - m;
        int u1 = w;

        sort(array, l, m, w);
        while (w-l > 1) {
            u1 = m;  
            m = (l+u1)/2;
            w = l + u1 - m;
            sort(array, w, u1, l);
            merge(array, l, m, u1+1, u, w);
        }
        insertionSort(array, l, u);  
        print(array, u);
    }