题库 软件开发 题目列表 以下是链表删除节点的算法,请补全代码。 DoubleNo...
填空题
以下是链表删除节点的算法,请补全代码。
DoubleNode* deleteTheNode(DoubleNode* head,int num)
{
	DoubleNode*p = head;
	if (p->data == num)
    {
        head = p->next;
        head->prev = NULL;
        free(p);
        return head;
    }
	
	while(p)
	{
		if (p->data == num)
        {
			[$##$];
			p->next->prev = p->prev;
			free(p);
			return head;
        }
		p = p->next;
	}
	
	printf("not found!\n");
	return head;
}

题目信息
校招真题
-
正确率
0
评论
11
点击