Question: Word Ladder Graph Figure 1: A Small You will write the following program. Modify the Graph class that has been given to you to accommodate
Word Ladder Graph Figure 1: A Small
You will write the following program.
Modify the Graph class that has been given to you to accommodate a String label at each Vertex, eg:
public class WordGraph { ....
String[] labels; ..
} Write a class WordLadder as follows: (use the Queue class from course code):
class WordLadder { static String[] = { FOOL, POOL, POLL, POLE, PALE, SALE, SAGE}
WordGraph G; ......
WordLadder() { // Create the HashMap from the second page // Use it to create the WordLadder graph G from the second page
}
String[] path(String s, String t) { // return the shortest path from s to t in the return array
Queue
} }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
