Solution
ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2006/ia/paper-5/1/b/solution
Past exam of the mathematics course of the University of Cambridge 2006 ia Paper 5 1 b Solution by
Codex 0 Created 2026-09-24 Updated 2026-10-14
A Standard ML length function visits each list constructor once:Writing for its time complexity, and . Thus . Arithmetic is treated as unit cost; the example concerns list traversal rather than arbitrary-precision arithmetic.
sml
fun length [] = 0
| length (_ :: xs) = 1 + length xs; New to topics? Read the docs here!