Is this the exact code you wre using? The function header needs to declare the types of the parameters (i.e. "int low, int mid, int high" instead of "low, mid, high"). Also, there is a curly bracket missing to close the function.
Next, this line
 current>prev=current>next>prev;
is kind of redundant. current>next>prev should bring you back to current, so why not write
well tht was the sample code i was using but now i changed it. now when i print the list it goes into an infinte loop but when i print the list in reverse it doesnt print all the nodes and the sequence is also wrong (prints the earlier reverse version where the list is not sorted).
eg: the list is 4 3 1 2
after sorting it should be 1 2 3 4 (forward print)
but when printing in forward it goes into infinte loop with 4
and for
reverse print i get 1 2 3 only but it should be 4 3 2 1.
here's the changed code:
 int merge(int low,int mid,int high)

{

int i,j,k;

i=low;

j=mid+1;

list *temp = new list();

list *temp1=new list();

current=first;

temp=current>next;

temp1>next=current>next;

temp1>prev=current>prev;


while(i<=mid && j<=high)

{

if(current>n <= temp>n)

{

current=current>next;

temp=current>next;

temp1>next=current>next;

temp1>prev=current>prev;

i++;

}

else

{

current>next=temp>next;

current>prev=temp;

temp>next=current;

temp>prev=temp1>prev;

j++;

}

}

}
what about the remaining part of the list? please tell me if this code successfully sorts the link list or not and what is the problem.
please tell me how exactly i should change the pointers.. this is creating a lot of confusion..please correct my code.
thank you in advance...