Store words in a list. For search, check each word against the pattern.
With n words of average length m, each search checks all words: .
For frequent searches, this becomes slow. Can you search more efficiently?
The trap
Store words in a list. For search, check each word against the pattern.
With n words of average length m, each search checks all words: .
For frequent searches, this becomes slow. Can you search more efficiently?