Question: Write a C++ program to solve word search puzzles using an unordered_set . Your code must be able to handle puzzles of arbitrary dimensions; use

Write a C++ program to solve word search puzzles using an unordered_set.

Your code must be able to handle puzzles of arbitrary dimensions; use the dictionary dictionary.txt; use an unordered_set to store the dictionary; and sort the output list of words of length 6 or more, along with their starting and ending positions alphabetically. Report the output for this puzzle.txt (can use any random word search file).

A word search puzzle is an AB array of lowercase letters, and the objective is to locate and output all dictionary words of length 6 or more that appear in this grid horizontally, vertically, or diagonally and either forwards or backwards (but no wrap-arounds).

For example, given the following puzzle: r d z i t p m f t e k a n s t d e l z z u p o o k e l a h w a a c j i e p n d k s d e o e m z i h z i y l a t x i s h h e e l s

the output should be: elephant from (7, 4) to (0, 4), puzzle from (2, 5) to (2, 0)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!