From 8decea79c031f94a1aa08f6f7e184796ea555a78 Mon Sep 17 00:00:00 2001 From: ondravasi <75139518+ondravasi@users.noreply.github.com> Date: Thu, 27 Feb 2025 15:59:51 +0100 Subject: [PATCH] Update lab02.md Task 1 had different function names (average-list lst) (average-lst '(1 2 3)) --- labs/lab02.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab02.md b/labs/lab02.md index 683439f..02df2dd 100644 --- a/labs/lab02.md +++ b/labs/lab02.md @@ -132,7 +132,7 @@ frequencies in English alphabet [Wikipedia](https://en.wikipedia.org/wiki/Letter ## Task 1 Write a function `(average-list lst)` taking a list of numbers `lst` and returning their -arithmetical average. E.g. `(average-lst '(1 2 3)) => 2`. The function should be tail-recursive. +arithmetical average. E.g. `(average-list '(1 2 3)) => 2`. The function should be tail-recursive. **Hint:** As the function should be tail-recursive, it has to use an accumulator storing a partial sum of elements from the list. Finally, the resulting sum is divided by the number of all elements