Update linked_list.cpp

This commit is contained in:
Christian Clauss
2020-04-22 16:09:12 +02:00
committed by GitHub
parent 367b981810
commit a9cbc06fd7

View File

@@ -9,18 +9,18 @@ node *start;
void insert(int x) {
node *t = start;
node *n = new node;
n->val = x;
n->next = NULL;
if (start != NULL) {
while (t->next != NULL) {
t = t->next;
}
node *n = new node;
t->next = n;
} else {
node *n = new node;
start = n;
}
n->val = x;
n->next = NULL;
}
void remove(int x) {