

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


void addLink (struct LinkedList * lst, struct dlink * lnk, EleType e);
void removeLink (struct linkedList * lst, struct dlink * lnk);
struct dlink { EleType value; struct dlink * next; struct dlink * prev; }; struct linkedList { struct dlink * frontSentinel; struct dlink * backSentinel; int size; }; /* the following functions were written in earlier lessons */ void linkedlistInit (struct linkedList *lst); void linkedListFree (struct linkedList lst); void _addLink (struct linkedList * lst, struct dlink * lnk, EleType e); void _removeLink (struct linkedList * lst, struct dlink * lnk); void linkedListAdd (struct linkedList * lst, EleType e) { _addLink(lst, lst->frontSentinel, e); } / you must write the following */ int LinkedListContains (struct linkedlist *lst, EleType e) { } void LinkedListRemove (struct linkedList *lst, EleType e) { }