typedef struct Dnode
{
ElemType data;
struct Dnode *prior,*next;
//双链表的结构定义
}DNode,*DoubleList;
int DlinkIns(DoubleList L,int i,ElemType e)
{
DNode *s,*p;
...../*先检查待插入的位置i是否合法(实现方法同单链表的前插操作)*/....
...../*若位置合法。则找到第i个结点并让指针p指向它*/.....
s=(DNode*)malloc(sizeof(DNode));
if(s)
{
s->data=e;
s->prior=p->prior;
p->prior->next=s;
s->next=p;
p->next=s;
return TRUE;
}
else return FALSE;
}