1void llDeleteNode(List &list, Node* node)
2{
3 if(list == node)
4 list = llNext(list);
5 else
6 {
7 List temp = list;
8 while (llNext(temp) != node)
9 temp = llNext(temp);
10
11 temp->next = node->next;
12 }
13
14 delete node;
15}
16
17void llClear(List &list)
18{
19 while(list != NULL)
20 llDeleteNode(list, list);
21}