Question: Homework : Word Ladder You may need to implement a few functions but you are required to implement the following function bool wordLadder(string word,



Homework : Word Ladder You may need to implement a few functions but you are required to implement the following function bool wordLadder(string word, string wordFinal, const vector & words, vector & ladder) this will be a recursive function, word is the current word that is being processed in the word ladder (current word you're on in the word ladder), wordFinal is the word youare trying to reach, words is your dictionary of words, and ladder contains all the words that arecurrently in the word ladder. This will require recursive backtracking, .e. when you're on a current word you need to try all of its adjacent words one at a time (one function call for each), and based onwhat is returned (true/false), Contents of main In main, you prompt for an input file that contains the dictionary. Then you read in two words (the start and end of the word ladder), you can assume both words are in the dictionary. If a solution exists, output the word ladder, otherwise output the solution does not exist. Make sure the output matches exactly withcode grade (in terms of upper/lower cased letters) Dictionary.dat aargh abaca abaci aback abaft abase abash abate abbey abbot abeam abend abets abhor abide abled abler abode abort about above absit abuse abuts abuzz abyss ached
Step by Step Solution
3.45 Rating (155 Votes )
There are 3 Steps involved in it
Poogoomme nclude Posseom Pnclude Pnclude using name space std boo... View full answer
Get step-by-step solutions from verified subject matter experts
