Shell排序法-Java实现

public static void shellSort(int[] a) {
		int i, j, h;
		int r, temp;
		int x = 0;

		for (r = a.length; r >= 1; r /= 2)
			for (i = r; i < a.length; i++) {
				temp = a[i];
				j = i - r;
				while (j >= 0 && temp < a[j]) {
					a[j + r] = a[j];
					j -= r;
				}
				a[j + r] = temp;
			}
	}
苟利国家生死以, 岂因祸福避趋之
原文地址:https://www.cnblogs.com/chintsai/p/10117046.html