Word Matching Algorithm

My main idea is to find an algorithm (Java) that accepts random letters that someone typed in JoptionPane, and then immediately click on "Find Words", I would like the program to output all those words that match my letters from the dictionary, stored in txt file.

I am trying to find this algorithm.

For instance:

Note that we got the following letters in a Scrabble match:

a, o, p, t, e, z, e, w

I would like to find java code or at least an algorithm to find all words that have these letters from the English .txt file, but not something else. if I type "a, p, p", I want to result in the word "application" and not (application "s"). So ... to summarize, how can I compare these letters with the words stored in the TXT file, and as a result get specific words that match in my letters?

+3
source share
2 answers

There are different ways to do this, depending on how efficiently you want it.

, , , , : , dict-file- ( , ).

, Trie (Prefix-Tree) [wikipedia], Trie.

EDIT: , , - , : , - , , Trie.

+3

: -

1. . , , , . : -
"" JOptionPane, .
2. , , .

+1

All Articles