template <class T>
T accumulate(T (*op)(T, T), T null_val, LList<T>& L)
{
T s = null_val;
L.IterStart();
elem_link1<T> *p = L.Iter();
while(p)
{
s = op(s, p->inf);
p = p->link;
}
return s;
}
template <class T>
LList<T> map(T (*f)(T), LList<T> & L)
{
L.IterStart();
elem_link1<T> *p = L.Iter();
LList<T> L1;
while(p)
{
L1.ToEnd(f(p->inf));
p = p->link;
}
return L1;
}