T select(T a[], int r, int i, int j)
	{
		int n = a.length;
		int pIndex = findPivot(a, i, j);
		int k = new QuickSorter<T>().partition(a, i, j, pIndex);

		int rPivot = n - k + 1;
		if (r == rPivot)
			return a[r];
		else if (r < rPivot)
			return select(a, r, k + 1, j);
		else if (r > rPivot)
			return select(a, r - (n - k + 1), i, k - 1);
		return null;

	}