so I need to write an efficient algorithm for looking up words with missing letters in a dictionary and I want the set of possible words.
For example, if I have th??
You can take a look at how its done in aspell. It prompts suggestions of correct word for misspelled words.