标签:blog class code java int 2014
static void shellsort(int a[], int n) { for (int gap = n / 2; gap >= 1; gap /= 2) { for (int i = gap; i < n; i++) { if (a[i] < a[i - gap]) { int temp = a[i]; int k = i - gap; while (k >= 0 && a[k] > temp) { a[k + gap] = a[k]; k -= gap; } a[k + gap] = temp; } } } }
标签:blog class code java int 2014
原文地址:http://blog.csdn.net/hackcoder/article/details/25193445