i want to write a swap function for a singly linked list. the function should take 2node pointers as input parameters and exchange their place in the linked list. this is what i tried out :
please point out where i went wrong. thanks in advance!!!
void swap(node *p,node *q)
/*assigning the previous and current nodes*/
/*swapping for q in the place of p*/
/*swapping for p in the place of q*/