public void sortArray() {

        this.arrayAccess = 0;
        this.comparisions = 0;

        int arrLength = this.array.length;
        /**
         * This denotes the index of the minimum element. It is assumed that the
         * first element during the iteration is the minimum and then the array
         * is scanned till the end to find a value that is smaller than that and
         * finally the current iteration's minimum is swapped into place which
         * is just before the last iteration's minimum. We can see that why this
         * is not "Online" and not "Stable".
         */
        int iMin;
        /**
         * Iterate through the array once. No need to look for the last element
         * since it will contain the largest number automatically.
         */
        for (int i = 0; i < arrLength - 1; i++) {
            /**
             * Assume the current index to be the index holding the minimum
             * value.
             */
            iMin = i;
            /**
             * Scan through the array starting from one element next to the
             * current index "i+1" till "arrLength-1". Check if the "j"th
             * element is lower than "iMin". If so, update "iMin".
             */
            for (int j = i + 1; j < arrLength; j++) {
                if (isLesser(j, iMin)) {
                    iMin = j;
                }
                this.arrayAccess += 2;
                this.comparisions++;
            }
            /**
             * If the index was not changed at all during the process, or if the
             * "i"th element itself was the local minimum, then there is no need
             * to swap. Else swap them.
             */
            if (iMin != i) {
                this.swapArrayValues(i, iMin);
            }

        }
    }