#include<stdio.h>
#include<stdbool.h>
void shellSort(int arr[],int length)
{
int gap, i, j;
int temp;
for (gap = length >> 1; gap > 0; gap >>= 1)
{
for (i = gap; i < length; i++)
{
temp = arr[i];
for (j = i - gap; j >= 0 && arr[j] > temp; j -= gap)
{
arr[j + gap] = arr[j];
}
arr[j + gap] = temp;
}
}
}
int main()
{
int a[] = { 12,232,34,34,45,4,6,56,53,4,423,2 };
int n = sizeof(a) / sizeof(int);
shellSort(a,n);
for (int i = 0; i < n; i++)
{
printf("%d\t",a[i]);
}
getchar();
return 0;
}