单链表逆置
typedef struct lnode{datatype data;
struct lnode *next;
}lnode,*linklist;
void reverse(linklist h)
{lnode *p,*q;
p=h->next;
h->next=NULL;
while(p)
{q=p;
p=p->next;
q->next=h->next;
h->next=q;
}
}
这个算法俺不懂 大家详细解释下吧
对不对啊
2010-03-04 21:32
2010-03-04 21:55
2010-03-05 14:17
2010-03-05 15:29
2010-03-05 21:04
2010-03-05 21:07
2010-03-05 21:08