public static void mergeSortWithOutRecursion(Integer[] array, int size) {
        Integer b[];
        int right, rend;
        int i, j, m;

        b = new Integer[size];

        for (int k = 1; k < size; k *= 2 ) {
            for (int left = 0; left + k < size; left += k * 2 ) {
                right = left + k;
                rend = right + k;

                if (rend > size) {
                    rend = size;
                }

                m = left;
                i = left;
                j = right;

                while (i < right && j < rend) {
                    if (array[i] <= array[j]) {
                        b[m] = array[i];
                        i++;
                    } else {
                        b[m] = array[j];
                        j++;
                    }
                    m++;
                }

                while (i < right) {
                    b[m] = array[i];
                    i++;
                    m++;
                }

                while (j < rend) {
                    b[m] = array[j];
                    j++;
                    m++;
                }

                for (m = left; m < rend; m++) {
                    array[m] = b[m];
                }
            }
        }
    }