Use C# para implementar a classificação Hill. A classificação Hill é baseada na classificação por inserção e melhora a classificação por inserção.
public static int[] XiErSort(int[] num)
{
for (int step = num.Length/2; step > 0; step/=2)
{
for (int i = step; i < num.Length; i++)
{
int noNumSort = num[i];
int sortIndex = i - step;
while (sortIndex >= 0 && noNumSort < num[sortIndex])
{
num[sortIndex+step] = num[sortIndex];
sortIndex -= step;
}
num[sortIndex + step] = noNumSort;
}
}
return num.ToArray();
}