500,000 street names - what data structure and to use to implement a fast search?

algorithm, autocomplete, data-structures, java, search

Solution

What you are looking for is some sort of compressed trie representation. You might want to look into succinct tries or DAWGs as a starting point, as they give excellent efficiency and very good space usage.

Hope this helps!

Problem

So we have many street names. They come in a file. Id probably cache them when booting the server up in production. The search should be auto complete like - e.g. you type 'lang ' and you would get maybe 8 hits : langstr, langestr. Etc

Original source