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 e
in 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
{