算法导论 练习题 10.2-7

来源:互联网 发布:4gip网络加速器 费用 编辑:程序博客网 时间:2024/05/17 00:12
typedef struct ListType{int key;ListType *next;}ListEl,*Lptr;Lptr reverse(Lptr head){Lptr p=head,q=p->next;while(q != NULL){Lptr r=q->next;q->next=p;p=q;q=r;}head->next=NULL;return p;}

0 0
原创粉丝点击