算法已经写清楚了,里面的first 就是你传入的hlinktemplate void mylist::Invert()//翻转{ if ( IsNull() || ncount == 1) return; listnode* m,* n; m = first; while (m!=NULL) { listnode* r = n; n = m; m = m->link; n->link = r; } first = n;}