mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-09 21:47:07 +08:00
Reduce code in linked_list.cpp
@mariangusatu Your review please.
This commit is contained in:
@@ -14,15 +14,13 @@ void insert(int x) {
|
||||
t = t->next;
|
||||
}
|
||||
node *n = new node;
|
||||
t->next = n;
|
||||
n->val = x;
|
||||
n->next = NULL;
|
||||
t->next = n;
|
||||
} else {
|
||||
node *n = new node;
|
||||
n->val = x;
|
||||
n->next = NULL;
|
||||
start = n;
|
||||
}
|
||||
n->val = x;
|
||||
n->next = NULL;
|
||||
}
|
||||
|
||||
void remove(int x) {
|
||||
|
||||
Reference in New Issue
Block a user