/*
	双链表 
*/
#include <stdio.h>
#include <malloc.h>
typedef int ElemType; 
typedef struct DuLNode{
	ElemType data;
	struct DuLNode * prior, * next;
}DuLNode, * DuLinkList;

/*
	获取第i个元素所在的地址 
*/
DuLinkList GetElemP_Dul(DuLinkList L, int i){
	DuLinkList p;
	p = L->next;
	int j = 1;
	while(p && i > j){
		p = p->next;
		j++;
	}
	if(!p || j > i) return NULL;
	return p;
} 

/*
	双向链表的插入 
*/
int ListInsert_Dul(DuLinkList L, int i, ElemType e){
	DuLinkList p, s;
	p = GetElemP_Dul(L, i);
	if(!p)return -1;
	s = (DuLinkList)malloc(sizeof(DuLNode));
	s->data = e;
	s->prior = p->prior;
	p->prior->next = s;
	p->prior = s;
	s->next = p;
	return 1;
} 

/*
	双向链表的删除 
*/
int ListDelete_Dul(DuLinkList L, int i, ElemType e){
	DuLinkList p, s;
	p = GetElemP_Dul(L, i);
	if(!p)return -1;
	p->prior->next = p->next;
	p->next->prior = p->prior;
	free(p);
	return 1;
}
int main(){	
	return 0;
} 
我亦无他,惟手熟尔