public void quickSort(int[] arr, int left, int right) {
		// O(nlogn)
		//worst-case:O(n^2)
		if (arr.length == 0 || arr == null)
			return;
		// get the mid point, and then get the pivot
		int mid = left + (right - left) / 2;
		int pivot = arr[mid];
		int i = left, j = right;

		while (i <= j) {
			while (arr[i] < pivot)
				i++;
			while (arr[j] > pivot)
				j--;
			// exchange the element
			if (i <= j) {
				int temp = arr[i];
				arr[i++] = arr[j];
				arr[j--] = temp;
			}
		}
		// recursively call the function for the sub-part
		if (left < j) {
			quickSort(arr, left, j);
		}
		if (right > i) {
			quickSort(arr, i, right);
		}
	}