template<typename LinkList> void converse(LinkList*L) { LinkList *p, *q; p = L->next; L->next = NULL; while (p) { q = p; p = p->next; q->next = L->next; L->next = q; } }
时间: 2024-11-07 09:41:59
template<typename LinkList> void converse(LinkList*L) { LinkList *p, *q; p = L->next; L->next = NULL; while (p) { q = p; p = p->next; q->next = L->next; L->next = q; } }