Possible Duplicate:
Build an index for substring search?
I'm developing a filename search tool. I'd like to search a harddrive (or multiple harddrives) for, perhaps, millions of filenames.
Given the file: application 3 - jack smithinson
Searches:
- '
application
', '3
', 'jack
', 'smithinson
' - '
smith
' - '
inson
'
Should all return this file.
What are the best data structures for this kind of operation and why?
- Binary tree.
- Trie.
- SQLite Database, of filenames
- More?