int main(void)
{
node*head,*tail,*p,*q;
head=tail=Creatnode(0);
int i,a[6]={1,9,2,6,7,3};
for(i=0;i<6;i++)
{
p=Creatnode(a[i]);
p->next=head;
head->pr=p;
head=p;
}
//正向输出
cout<<"follw direction output"<<endl;
Display1(head);
//反向输出
cout<<"opposite direction output"<<endl;
Display2(tail);
//cout<<"the sorted arry"<<endl; //整体排序
//sort(head);
//Display1(head);
//前两位交换
cout<<"swap between the prior two"<<endl;
SwapHead(head);
Display1(head);
//末尾两位交换
cout<<"swap between the Last two"<<endl;
SwapTail(tail);
Display1(head);
// 其中两位交换
cout<<"swap between the inside two"<<endl;
SwapInside(head);
Display1(head);
//首位交换
cout<<"swap between Head and Tail"<<endl;
SwapHT(head,tail);
Display1(head);
return 0;
}