向双向链表的第i位置插入一个节点 双向链表的定义如下 typedef struct _node { int data; struct node *prior; struct node *next; }node; 可以定义一个工作节点,然后在定义一个工作节点的前驱节点,具体代码如下: /****************************** * Designer:LiuJinXun * Date:2010/04/13 * Purpose: Just For Practice *****************************/ int del_node(node *head,int i) { node *p = head->next;//工作节点 node *q = head; //illegal input data if(i < 1 || i > length(head)) { return 0; } else { for(int j =1,j <i; ++j) { p = p->next; q = q->next; } //if current node is not NULL if(p->next != NULL) { q->next = p->next; p->next->prior = q; } else { q->next = p->next; } free(p); } return 1; }