标签:
static void shell_sort(int[] unsorted, int len) { int group, i, j, temp; for (group = len / 2; group > 0; group /= 2) { for (i = group; i < len; i++) { for (j = i - group; j >= 0; j -= group) { if (unsorted[j] > unsorted[j + group]) { temp = unsorted[j]; unsorted[j] = unsorted[j + group]; unsorted[j + group] = temp; } } } } }
标签:
原文地址:http://www.cnblogs.com/greyhh/p/4709603.html