请问一下这个想把单链表逆置哪里错了,
void Link_list::ListViper()
{ node *x,*y;
T z;
if (head==NULL )
{
return ;
}
else if(head->next=NULL)
{
return;
}
else
{
y=head->next;
head->next=NULL;
z=head->data;
while(y!=NULL)
{
x=y;
ListInsert(z,y->data);
z=y->data;
y=y->next;
delete x; }
}
}