typedef struct dlistnode{
DataType data;
struct dlistnode *prior,*next;
}DlistNode;
typedef DlistNode *DlinkList;
void DInsertBefore(DlistNode *p,DataType x){
DlistNode *s=malloc(sizeof(DlistNode));
s->data=x;
s->prior=p->prior;
s->next=p;
p->prior->next=s;
p->prior=s;
}
void DDeleteNode(DListNode *p){
p->prior->next=p->next;
p->next->prior=p->prior;
free(p);
}
双向链表
最新推荐文章于 2024-09-13 11:50:55 发布