Hi guys, how ya doing. Here I have a small problem with my doubly linked list. The thing is that I am trying to do in the pasted code below is that, I am trying to swap the two nodes by it's position. I tried it but smells like it doesn't work at all. Can you guys suggest me what's wrong or better way to do it. please guys i need your help.
I will really appreciate.
thanks
/* swap the data between two nodes */
void ALinkedList::swap(int pos1, int pos2) {
Node *curr1 = head;
Node *curr2 = head;
int temp;
int temp1;
int temp2;