public static void sort(Comparable[] a)
	{
		// Sort a[] into increasing order.
		int N = a.length;
		int h = 1;
		while (h < N / 3)
			h = 3 * h + 1; // 1, 4, 13, 40, 121, 364, 1093, ...

		// h-sort the array.
		while (h >= 1)
		{
			// Insert a[i] among a[i-h], a[i-2*h], a[i-3*h]... .
			for (int i = h; i < N; i++)
				for (int j = i; j >= h && SortHelper.less(a[j], a[j - h]); j -= h)
					SortHelper.exch(a, j, j - h);
			h = h / 3;
		}
	}