lundi 2 mars 2015

How do you insert a value at the end of a LinkedList?



I'm trying to add a value given to the end of a LinkedList. I know how to iterate to the end of the LinkedList but I'm not sure where to go from there.



void llist_insert_last(LinkedList * list, int value) {
ListNode * e = list->head;
while(e != NULL) {
e = e->next;
}
}



Aucun commentaire:

Enregistrer un commentaire