Asymptotically fast associative array with low memory requirements

Well, there have been attempts for a while. A typical implementation should give you O (m) search, insertion and deletion of operations regardless of the size n of the data set, where m is the length of the message. However, the same implementation takes 256 words for each input byte, in the worst case.

Other data structures, in particular hashing, provide the expected O (m) lookup, insertion, and deletion, and some implementations even provide constant time lookups. However, in the worst case, the routines either do not stop or do not take O (nm) time.

Question: Is there a data structure that provides O (m) time for searching, inserting, and deleting while maintaining a memory size comparable to hash or search trees?

Perhaps it would be appropriate to say that I am only interested in the worst behavior, both in time and in space.

+3
source share
4 answers

Have you tried to try Patricia - (alias critbit- or Radix-)? I think they solve the problem of the worst space.

+4
source

There is a structure known as a suffix array. I cannot recall the research in this area, but I think that they got pretty damn close to O (m) search time with this structure, and it is much more compact than your typical tree-based indexing methods.

Dan Husfield's book is a bible of string algorithms.

0
source

, :

  • , .
  • , node , - , /, . . trie , - .

, / , , , . , / , "" , , .

, , trie node, . node trie -. . c * m, - - , c - / .

0

, , , :

Here you can see the standard here . They work as fast as a hash table, but with a lower memory requirement and a better worst case.

0
source

Source: https://habr.com/ru/post/1756581/


All Articles