scott <sco### [at] laptopcom> wrote:
> You made it simpler, I can make the first one simpler too :-)
> 1. If LIST is not the empty list, then SUM(LIST) is defined as the result of
> adding up the value at each node of LIST
I can make it even simpler:
1. SUM(LIST) = the sum of the values of all nodes in LIST
In some imperative languages that can be written as something along the
lines of:
sum = 0;
foreach(element in list) sum += element;
(In some languages even the first line can be omitted if its default
behavior is that undeclared integral variables are automatically created
and initialized to 0.)
--
- Warp
Post a reply to this message
|