Linux循序渐进
istvh
全部博文(172)
2011年(6)
2010年(7)
2009年(159)
帮我Q下
cynthia
Phyllis6
浪花小雨
Bsolar
wangkai8
BlueCat_
cool138
Anzyfly
分类: LINUX
2009-11-07 18:09:48
struct node heada, headb; link t, u, x, a = &heada, b; for (i = 0, t = a; i < N; i++) { t->next = malloc(sizeof *t); t = t->next; t->next = NULL; t->item = rand() % 1000; } b = &headb; b->next = NULL; for (t = a->next; t != NULL; t = u) { u = t->next; for (x = b; x->next != NULL; x = x->next) if (x->next->item > t->item) break; t->next = x->next; x->next = t; }
上一篇:链表求逆
下一篇:字符串查找
登录 注册