CLRS
vizee
这个作者很懒,什么都没留下…
展开
-
heapsort
#define PARENT(__i) (__i / 2) #define LEFT(__i) (__i * 2) #define RIGHT(__i) (__i * 2 + 1) int heap_size,length; /*inline*/void exchange(int *a,int *b) { *a ^= *b; *b = *a ^ *b; *a ^= *b; return原创 2012-08-01 08:19:44 · 444 阅读 · 0 评论 -
bubblesort
int length; /*inline*/void exchange(int *a,int *b) { *a ^= *b; *b = *a ^ *b; *a ^= *b; return; } void bubblesort(int A[]) { int i,j; for(i = 1;i <= length;i++) for(j = length;j > i;j--)原创 2012-08-01 08:37:39 · 471 阅读 · 0 评论