void ins_after(struct node *node, struct node *new_node)
{
new_node -> next = node -> next;
node -> next = new_node;
new_node -> next -> prev = new_node;
new_node -> prev = node;
}
当我尝试将节点插入双重列表时,上面的代码给出了段错误。知道为什么吗?=/
void ins_after(struct node *node, struct node *new_node)
{
new_node -> next = node -> next;
node -> next = new_node;
new_node -> next -> prev = new_node;
new_node -> prev = node;
}
当我尝试将节点插入双重列表时,上面的代码给出了段错误。知道为什么吗?=/