I am creating a project (using NetBeans for GUI) for my Data Structures and Algorithms course. The gist of it is as follows:
-Take 7 letters as input
-Display a valid word as output (And later, when this issue is hopefully resolved, several words)
Basically a software one could theoretically use to cheat in games like Scrabble. This is the procedure i am using:
-Make a hashed-table of linked lists of the words a provided dictionary, such that each linked list contains only words that start with a particular letter, ex:
-Make a linked list of all permutations of the 7 letters (currently assuming no repitition).
-For every letter in the permutations, use the relevant row in the hash table to see if that permutation is a legal word
-if it is, print it and break.
This algorithm is working, but it is taking WAY to long. If i type in "pelicna", it returns "pelican" in a few seconds, but if i type somthing like "ncilepa", it could take up to 10 minutes and either print the word, or even return a NullPointerException. Could you guys help me out here?