Entry 3364
Shellsort
Submitted by anonymous
on March 16, 2010 at 9:31 a.m.
Language: C. Code size: 343 bytes.
void shell(int a[], int N){ int i, j, h, temp; for(h=1; h<N/9; h=3*h+1); for(; h>0; h=h/3){ for(i=h; i<N; i++){ temp=a[i]; j=i; while (j>h-1 && a[j-h]>v){ a[j] = a[j-h]; j = j-h; } a[j] = temp; } } }
This snippet took 0.00 seconds to highlight.
Back to the Entry List or Home.