public void sort(T[] a, int lo,
			int hi)
	{
		if (hi <= lo)
			return;

		int lt = lo;
		int gt = hi;
		int i = lo;

		T v = a[lo];
		while (i <= gt)
		{
			int cmp = a[i].compareTo(v);
			if (cmp < 0)
				exch(a, i++, lt++);
			else if (cmp > 0)
				exch(a, i, gt--);
			else
				i++;
		}

		sort(a, lo, lt - 1);
		sort(a, gt + 1, hi);
	}