设两个变量记录头节点和尾节点,然后把头节点的pre指向尾节点,把尾节点的next指向头节点
p=head;p=p->next;while(p->next!=head){p->next->pre=p;p=p->next;}head->next->pre=p;