reverse linked list

Can you please check my reverse linked list function? does it look okey? thanks.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void ReverseLinkedList (nodeType *first)
{
	nodeType *q,*r,*s;
	q=first;
	r=NULL;
	while(q!=NULL)
		{//all of these pointers proceed one step ahead
			s=r;
			r=q; 
			q=q->link;
			r->link=s;
		}

		first=r;
		
}
Topic archived. No new replies allowed.