smallest([h]) = h smallest(h:t) = min(h, smallest(t)) (when t ≠ [])Converting to C++ yields the following.
int smallest(const List L)
{
if(isEmpty(tail(L)))
{
return head(L);
}
else
{
return min(head(L), smallest(tail(L)));
}
}