private void quicksort(int low, int high)
	{
		incrementRekursionDepth();
		int i = low, j = high;

		// comparison element 
		// is median of the array values with highest, lowest and middle index

		int middle = (low + high) / 2;
		int comparisonElement;
		if (array[countStep(middle)] < array[countStep(high)] && array[countStep(middle)] > array[countStep(low)])
		{
			comparisonElement = array[countStep(middle)];
		} else if (array[countStep(middle)] > array[countStep(high)])
		{
			comparisonElement = array[countStep(high)];
		} else
		{
			comparisonElement = array[countStep(low)];
		}

		// splitting
		while (i <= j)
		{
			while (array[countStep(i)] < comparisonElement)
				i++;
			while (array[countStep(j)] > comparisonElement)
				j--;
			if (i <= j)
			{
				exchange(i, j);
				i++;
				j--;
			}
		}

		// recursion
		if (low < j)
			quicksort(low, j);
		if (i < high)
			quicksort(i, high);
	}