3 ms·
Looking up a small key in a table to get a value is easy. Looking up a big key can be done by looking up part of the key to get a second lookup table, in which
by 082349872349872 3y ago
Looking up a small key in a table to get a value is easy.
Looking up a big key can be done by looking up part of the key to get a second lookup table, in which the rest of the key is then looked up to get the value.
If the set of values is finite, the set of keys can be infinite by using a suitable graph of lookup tables. (this /!\ is the non-intuitive step)
If one can find a suitable compact set of functions, it's even possible to "look up" an infinite set of values: look up the right function for the key, then apply it to produce the corresponding value.