template void linkedlist::reverselist()
{
nodeptr ptr = headd;
nodeptr nextptr = ptr->_next;
while(nextptr)
{
nodeptr temp = nextptr->_next;
nextptr->_next = ptr;
ptr = nextptr;
nextptr = temp;
}
head->_next = 0;
head = ptr;
}
{
nodeptr ptr = headd;
nodeptr nextptr = ptr->_next;
while(nextptr)
{
nodeptr temp = nextptr->_next;
nextptr->_next = ptr;
ptr = nextptr;
nextptr = temp;
}
head->_next = 0;
head = ptr;
}
Comments
Post a Comment
https://gengwg.blogspot.com/