void insert(node *p,int value)
{
node * head;
head->data = value;
if(p == NULL) { //如果链表为空
head->pre = head->next = head;
p = head;
return;
}
head->pre = p->pre;
head->next = p;
p = head; //改变头结点
return
}
node head;
void insert(node *p,int value)
{
head->data = value;
p->pre=head.pre;
head.pre.next=*p;
p->next=head;
head.pre=*p;
}
这样的话链短不了。