This is an old revision of the document!


H01. Functional Sets

Sets are unordered collections of unique elements. There are several ways to store sets. One of them relies on characteristic functions. Such functional sets are especially useful if we expect many insert/retrieve operations and less traversals in our code.

A characteristic function of a set $ A \subseteq U$ is a function $ f: U \rightarrow \{0,1\}$ which assigns $ f(x) = 1$ for each element $ x \in A$ and $ f(x) = 0$ for each element $ x \not\in A$ .