Storing a sparse table

The problem of storing and searching large sparse tables is ubiquitous in computer science. The standard technique for storing such tables is hashing, but hashing has poor worst-case performance. We propose a good worst-case method for storing a static table of <italic>n</italic> entries, each an integer between 0 and <italic>N</italic> - 1. The method requires <italic>O</italic>(<italic>n</italic>) words of storage and allows <italic>O</italic>(log<subscrpt>n</subscrpt> <italic>N</italic>) access time. Although our method is a little complicated to use in practice, our analysis shows why a simpler algorithm used for compressing LR parsing tables works so well.