#include
#include
#include
#include
using
typedef
{
int
struct
struct
}dnode;
//建立双链表
dnode
{
dnode
int
head
p
while(cycle)
{
printf("\nplease
scanf("%d",&x);
if(x
{
s
s->data
printf("\n
p->next
s->pre
p
}
else
cycle
}
head
head->pre
p->next
printf("\n
return
}
//链表测长
int
{
int
dnode
p
while(p
{
p
n++;
}
return
}
//链表打印
void
{
dnode
int
n
printf("\nNow,These
p
if(head
{}
while(p
{
printf("
p
}
}
//双链表删除节点
dnode
{
dnode
while((x
{
p1
}
if(x
{
if(p1
{
head
head->pre
free(p1);
}
else
{
p1->pre->next
free(p1);
}
else
{
p1->next->pre
p1->pre->next
}
}
else
printf("\n%d
return
}
//双链表插入节点(在第k个节点后插入)
dnode
{
dnode
int
L
p1
p0
p0->data
if(k
printf("\nout
for(i=1;
{
p1
}
if(k)
{
if(k
{
p1->next
p0->pre
p0->next
}
else
{
p0->next
p0->pre
p1->next
p1->next->pre
}
}
else
{
p0->next
p0->pre
p1->pre
head
}
return
}
int
{
dnode
a
length(a);
print(a);
printf("\nPlease
int
scanf("%d",&x);
head_del
print(head_del);
printf("\nPlease
int
scanf("%d",&k);
scanf("%d",&y);
printf("\nk
head_ins
print(head_ins);
return
}