public void mergeArray(int low, int middle, int high) {
        /**
         * Copying the whole set of values first.
         */

        for (int i = low; i <= high; i++) {
            this.auxArray[i] = this.array[i];
            this.arrayAccess += 2;
        }

        /**
         * Copying the indices for the left and the right sub-arrays which are
         * nothing but an indexed access of the auxiliary array. "primeIndex" is
         * the index for the main array which will take the merged values.
         */
        int leftIndex = low;
        int rightIndex = middle + 1;
        int primeIndex = low;

        /**
         * Now as long as there are values in the left or right arrays, just
         * keep the loop running.
         */
        while (true) {
            /**
             * Break as soon as one of them crosses over.
             */
            if (leftIndex > middle) {
                break;
            }
            if (rightIndex > high) {
                break;
            }

            /**
             * If the leftValue is <= rightValue, then put it in the primary
             * array.
             */
            if (isLesser(leftIndex, rightIndex)
                    || isEqual(leftIndex, rightIndex))

                this.array[primeIndex++] = this.auxArray[leftIndex++];

            else

                this.array[primeIndex++] = this.auxArray[rightIndex++];

            this.comparisions++;
            this.arrayAccess += 4;

        }
        while (leftIndex <= middle) {
            this.array[primeIndex++] = this.auxArray[leftIndex++];

            this.arrayAccess += 2;
        }
        while (rightIndex <= high) {
            this.array[primeIndex++] = this.auxArray[rightIndex++];

            this.arrayAccess += 2;
        }
    }