Skip to main content
added 36 characters in body
Source Link
Florian F
  • 591
  • 4
  • 9

123 chars (+3 newlines)

A standard Shell sort, compressed.

d,i,j;float t;
void sort(float*v,int n){
for(d=1<<20;i=d/=2;)for(;i<n;v[j]=t)for(t=v[j=i++];j>=d&&v[j-d]>t;j-=d)v[j]=v[j-d];
}  

PS: discovered it is still 10x slower than quicksort.. You might as well ignore this entry.

123 chars (+3 newlines)

A standard Shell sort, compressed.

d,i,j;float t;
void sort(float*v,int n){
for(d=1<<20;i=d/=2;)for(;i<n;v[j]=t)for(t=v[j=i++];j>=d&&v[j-d]>t;j-=d)v[j]=v[j-d];
}  

PS: discovered it is still 10x slower than quicksort...

123 chars (+3 newlines)

A standard Shell sort, compressed.

d,i,j;float t;
void sort(float*v,int n){
for(d=1<<20;i=d/=2;)for(;i<n;v[j]=t)for(t=v[j=i++];j>=d&&v[j-d]>t;j-=d)v[j]=v[j-d];
}  

PS: discovered it is still 10x slower than quicksort. You might as well ignore this entry.

added 57 characters in body
Source Link
Florian F
  • 591
  • 4
  • 9

123 chars (+3 newlines)

A standard Shell sort, compressed.

d,i,j;float t;
void sort(float*v,int n){
for(d=1<<20;i=d/=2;)for(;i<n;v[j]=t)for(t=v[j=i++];j>=d&&v[j-d]>t;j-=d)v[j]=v[j-d];
}  

PS: discovered it is still 10x slower than quicksort...

123 chars (+3 newlines)

A standard Shell sort, compressed.

d,i,j;float t;
void sort(float*v,int n){
for(d=1<<20;i=d/=2;)for(;i<n;v[j]=t)for(t=v[j=i++];j>=d&&v[j-d]>t;j-=d)v[j]=v[j-d];
}  

123 chars (+3 newlines)

A standard Shell sort, compressed.

d,i,j;float t;
void sort(float*v,int n){
for(d=1<<20;i=d/=2;)for(;i<n;v[j]=t)for(t=v[j=i++];j>=d&&v[j-d]>t;j-=d)v[j]=v[j-d];
}  

PS: discovered it is still 10x slower than quicksort...

Source Link
Florian F
  • 591
  • 4
  • 9

123 chars (+3 newlines)

A standard Shell sort, compressed.

d,i,j;float t;
void sort(float*v,int n){
for(d=1<<20;i=d/=2;)for(;i<n;v[j]=t)for(t=v[j=i++];j>=d&&v[j-d]>t;j-=d)v[j]=v[j-d];
}