A
A
Artur Nurullin2015-08-28 10:56:55
Algorithms
Artur Nurullin, 2015-08-28 10:56:55

The fastest autocomplete + sorting, which date structure to choose?

Good afternoon.
There was a task of searching through autocomplete, I did trie, but sorting is very slow
150,000 words with a priority
of 10,000 requests, it should work no more than 10 seconds.
Console application, output 5 seconds

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artur Nurullin, 2015-09-03
@Splo1ter

Answer found, used 2 structures, trie+red-black trees.
Each node has a SortedSet collection, it works like a red-black-tree.
Accordingly, the collection includes all the nodes that pass the tree.
We end up with a sorted collection.
As for memory, it’s just not efficient, but classes are used there for the node, not structures. So only references are stored in the collection.
There was no memory requirement.

U
uvelichitel, 2015-08-28
@uvelichitel

  • Bloom filter.
  • Bor Aho-Korasik.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question