大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
#pragma once void ShellSort(int* array, size_t n) { int gap = n; while (gap > 1) { gap = gap/3 + 1; for (size_t i = 0; i < n-gap; ++i) { int end = i; int tmp = array[end+gap]; while ((end >= 0) && array[end] > tmp) { array[end+gap] = array[end]; end -= gap; } array[end+gap] = tmp; } } }