void removeAll(int x, List& L) { if(!isEmpty(L)) { if(head(L) == x) { List p = L; L = L->next; delete p; } remove(x, L->next)) } }