有这样定义结构体的吗
匚匚 2011-07-25 05:53:39 //难道说是伪代码?呵呵
struct LIST;
{
int i;
LIST* next;
}NODE;
LIST qsortL (LIST h, LIST lnext)
{
NODE n1, n2;
LIST p, t1 = &n1, t2 = &n2;
if (h == NULL) return lnext;
for (p = h->next; p != NULL;
p = p->next)
if (p->i < h->i)
{
t1->next = p;
t1 = p;
}
else
{
t2->next = p;
t2 = p;
}
t1->next = t2->next = NULL;
h->next = qsortL(n2.next, lnext);
return qsortL(n1.next, h);
}