#include <iostream>#include <stdio.h> #include <stdlib.h>using namespace std;//带头指针的循环双链表typedef struct DNode{int data;struct DNode *next,*prior;}DNode, *DLinkList; // 初始化 bool initDlinklist(DLinkList &L){L = (DNode *)malloc(sizeof(DNode));if(L == NULL) return false;else{L->next = L;L->prior =L;}return true; } // 判空 bool empty(DLinkList L){return (L->next == L); } // 判断节点P是否是循环双链表尾节点 bool isTail(DLinkList &L,DNode *p){return (p->next == L);} // 在节点p之后插入s节点 闭环 bool insert_pnext(DNode *p,DNode *s){s->next = p->next;p->next->prior =s;s->prior = p;p->next =s; } //删除p的后继节点 q bool delete_pnext(DNode *p){DNode *q = p;p->next = q->next;q->next->prior =p;free(q);}int main(){DLinkList L;return 0; }