Okay so I am currently workng on an assignment where I have basically got to create a word ladder, eg. Click, Clock, Flock, Flick, so its a list of words with only 1 letter difference, and the same letters cant be reused. Now I can do 2 methods of doing this, the first (which I need help need help with right now) is generate, which the user inputs a word along with the number of steps, and then the program generates a word ladder for that word with the number of steps given.
Now there is another method but since Im not working on that right now, I am focusing on the generate and I need help with it. Here's the main code for the one class so far.
The main problem I am having with here is the Generate() and more precisely, the searchForNewWord method. The generate is fine to the point of needing the searchForNewWord, and this method needs to search for a new word once the user has first inputted the starting word for the word ladder. Now I am trying to use an iterator along with the already created hashtable but I am having trouble as to how to use this to its fully capacity. If someone can help explain how to get what I wish to do in a simple manner that would be fantastic.
So, you want a graph where each word object in the master container ihas the word and a container of references to words 1 character off. Then, you can walk the graph of one-off's avoiding retracing, to depth N. Does length always match, e.g., clocks is 1 letter different than clock? You might want length as a key for searching for one-off words during generate. Not sure what full capacity is, or how hash is really useful here, as opposed to a tree of length and value.
Indentation would be nice! Has anyone written a JAVA beautify yet? Many! We all deserve well formatted code. http://www.javaregex.com/jbeaut.html
Last edited by DGPickett; 10-22-2012 at 04:35 PM..
Saw an error while setting up an application called i2phex:
# ./run.sh
java.lang.RuntimeException: Failed to initialize phex.net.repres.i2p.I2PPresentationManager
at phex.common.ManagerController.initializeManagers(ManagerController.java:78)
at phex.Main.main(Main.java:161)After... (0 Replies)
Java is required for a game server I'm setting up..
I'm unable to install the java_ee_sdk-5_03-linux.bin self-executable.
Tried using chmod but didn't have any success.
Please help, I will be eternally greatfull :D (3 Replies)