template <class t>
void list <t> :: reverse (void)
{
node <t> *r=0, *q, *p;
if (first != 0)
{
q = first;
p = first -> getnext();
while (!p)
{
q->setnext(r);
r = q;
q = p;
p = p->getnext();
}
q->setnext(r);
first = q;
}
}