`#include `
#include
typedef struct _node {
int data
structure _node * next;
} node_t;
typedef struct {
node_t * head;
node_t * tail;
} LL_t;
LL_t * LLcreate () {
LL_t * ret = malloc (sizeof (LL_t));
ret-> head = NULL;
ret-> tail = NULL;
back ret
}
void LLappend (LL_t * intlist, int value) {
node_t * newNode = malloc (sizeof (node_t));
newNode-> data = value;
newNode-> next = NULL;
if (intlist-> head == NULL) {
intlist-> head = newNode;
intlist-> tail = newNode;
} else {
intlist-> tail-> next = newNode;
intlist-> tail = newNode;
}
}
void Remove (LL_t * intlist, int target) {
node_t * current = intlist-> head;
node_t * previous = NULL;
int temp = 0;
while (current! = NULL) {
if (current-> data == target) {
if (previous == NULL) {
intlist-> head = current-> next;
}
plus{
previous-> next = current-> next;
}
temp = 1;
}
if (previous == NULL) {
previous = intlist-> head;
current = current-> next;
}
plus{
previous = current;
current = current-> next;
}
}
if (temp == 0) {
printf ("The taget is not in the linked list");
}
}
void LLprint (LL_t * intlist) {
for (node_t * current = intlist-> head; current! = NULL; current = current-> next) {
printf ("% d n", current-> data);
}
}
int main (int argc, const char * argv[]) {
LL_t * intlist = LLcreate ();
LLappend (intlist, 332);
LLappend (intlist, 12);
LLappend (intlist, 23);
LLappend (intlist, 23);
LLappend (intlist, 22);
LLappend (intlist, 23);
Delete (intlist, 23);
LLprint (intlist);
returns 0;
}

My list is 332 23 12 23 23 22. The output is 332 12 23 22. But it should be 323 12 22.

The function can delete the element if it only occurs once or if the multiple targets shown in the list are not in a row. Who can help me fix the function? Thank you!