單鏈表的倒序

偶爾看到這麼個單鏈表的倒序,覺得寫的算法很好(可能我很少去研究算法的原因吧),不畫圖發現自己還真不知道怎麼寫的: 單鏈表的倒序: struct student *reverse(struct student *head) { struct student *p1,*p2,*p3; p2=head;p3=head->next; do { p1=p2;p2=p3;p3=p2->next;p2->nex
相關文章
相關標籤/搜索