public void sort(int low, int high) {
		
		if(low >= high)
			return;
		int i=low+1, j=high;
		int pivotIndex = low;
		
		while(i<=j) {
			// i,j comparison should come first
			while(i<=j && array[i] <= array[pivotIndex])
				i++;
			while(j>=i && array[j] > array[pivotIndex])
				j--;
			
			if(i<=j) {
				swap(i, j);
				i++; j--;
			}
		}
		// swap pivot and j
		swap(pivotIndex, j);
		sort(low, j-1);
		sort(j+1, high);
	}