Generating the permutations from a number of Characters
- by adam08
I'm working on a predictive text solution and have all the words being retrieved from a Trie based on input for a certain string of characters, i.e. "at" will give all words formed with "at" as a prefix. The problem that I have now, is that we are also supposed to return all other possibilities from pressing these 2 buttons, Button 2 and button 8 on the mobile phone, which would also give words formed with, "au, av, bt, bu, bv, ct, cu, cv" (most of which won't have any actual words.
Can anyone suggest a solution and how I would go about doing this for calculating the different permutations?
(at the moment, I'm prompting the user to enter the prefix (not using a GUI right now)