No CrossRef data available.
Article contents
Functional Pearls: The Minout problem
Published online by Cambridge University Press: 07 November 2008
Extract
The problem of computing the smallest natural number not contained in a given set of natural numbers has a number of practical applications. Typically, the given set represents the indices of a class of objects ‘in use’ and it is required to find a ‘free’ object with smallest index. Our purpose in this article is to derive a linear-time functional program for the problem. There is an easy solution if arrays capable of being accessed and updated in constant time are available, but we aim for an algorithm that employs only standard lists. Noteworthy is the fact that, although an algorithm using lists is the result, the derivation is carried out almost entirely in the world of sets.
- Type
- Article
- Information
- Copyright
- Copyright © Cambridge University Press 1991
Discussions
No Discussions have been published for this article.