6-183 Delete node from singly liked list

该博客介绍如何实现一个函数,从带有虚拟头结点的单链表中删除指定元素。函数接受链表头指针作为参数,并假设链表中无重复元素。
摘要由CSDN通过智能技术生成

In this problem you will implement a function to delete the specified element in a singly linked list with dummy header.

Format of functions:

void removeNode(List L, ElementType e);

The parameter L is a pointer to the dummy header. The function delete the specified element ein linked list L.

For the sake of simplicity, we assume that there are no duplicate elements in the linked list.(简单起见,我们约定链表中没有重复的元素)

where List is defined as the following:

typedef int ElementType; 
struct Node 
{ 
        ElementType data; 
        struct Node* next; 
}; 
typedef struct Node* PtrToNode; 
typedef PtrToNode List;

Sample program of judge:

#include <stdio.h>
#include <stdlib.h>

typedef int ElementType;

struct Node
{
 
  • 32
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值