初涉c语言之链表转置

来源:互联网 发布:龙源数据库论文查询 编辑:程序博客网 时间:2024/06/06 01:47
struct list *C(struct list *head){      //实现链表的转置    struct list *p=NULL,*q;    while(head!=NULL){     q=p;     p=head;        head=head->next;  p->next=q;       }    head=p;    return head;}
0 0