Source code for shell sort is provided below.
#include
#define NUM 6
main() {
int arr[NUM],i,j, incr=2;
// start reading nums
for(i=0;i0) {
for(i=incr;i0 && toInsert < arr[j-incr]);
arr[j] = toInsert;
}
}
incr = incr/2;
}
// print sorted arr
for(i=0;i
Please point your web links to this page if you are using this code for any purpose.