链表逆置函数:
template<class T>
Chain<T>& Chain<T>::Reverse()
{
ChainNode<T> *last = 0, *current = first,*next;
while (current) {
next = current->link;
current->link = last;
last = current;
current = next;
}
first = last;
return *this;
}
last指针指向已经逆置完的子链表的头结点;
current指针指向剩余子链表的头结点;
next指针指向剩余子链表的第二个节点。