Numbering.Make
The functor Make
requires an implementation of maps for the type M.key
and offers a two-phase numbering facility. The function encode
is backed by a map, therefore runs in logarithmic time or constant time, depending on the type of map that is used. The function decode
is backed by an array of size n
, therefore runs in constant time.