Tuesday, January 19, 2010

The tiniest C sort function

Came across this site and thought it was worth noting it down.

void s(int*a,int*b){for(int*c=b,t;c>a;)
if(t=*c--,*c>t)c[1]=*c,*c=t,c=b;}

http://www.cs.dartmouth.edu/~doug/tinysort.html

No comments: