 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
So,
to insert at the end would not
require a special
|
|
case
for if the list existed or not:
|
|
|
|
node *
current = head;
|
|
|
|
while
(current->next) //no seg fault!
|
|
|
|
current = current->next;
|
|
|
|
current->next
= new node;
|
|
|
|
current =
current->next;
|
|
|
|
current->data
= new_data;
|
|
|
|
current->next =
NULL;
|
|