Home > Back-end >  LNode * and LNode * & difference
LNode * and LNode * & difference

Time:10-09

Wrote a singly linked list of reverse function, but LNode * cannot correct output, LNode * & amp; Can, what reason is this?
//reverse singly linked list
Void reverse (LNode * & amp; The head)
{
LNode * p * q;
P=the head;
head=NULL;
while(p!=0)
{
Q=p;
P=p - & gt; Next;
Q - & gt; Next=head;
The head=q;
}
}
  • Related