Reference no: EM13967568
The Problem
Given an input dictionary read in from a file to use for all test cases, and several word search grids, identify all words from the dictionary that appear in each word search grid.
The Input
(of word search grids, to be read in from standard input) The first line of the input file will contain a single positive integer, c (c ≤ 100), representing the number of input cases. The input cases follow, one per line. The first line of each input case will contain two positive integers, r (4 ≤ r ≤ 300), and c (4 ≤ c ≤ 300), representing the number of rows and columns, respectively, in the word search grid. The following r lines will contain strings of exactly c characters, all of which will be lowercase letters for each row of the word search grid for that input case.
The Output
For each case, output a header with the following format:
Words Found Grid #k:
where k is the grid number starting with 1. (Please pay attention to the capitalization above, the pound sign and the colon. You will lose a small amount of credit if you don't use this exact format.)
Output all the words from the dictionary found in the grid on the following lines, one per line. You may output these in any order and you may output the same word more than once, but you should not output any string that isn't in the dictionary, or output any valid word that does not appear anywhere in the grid. I will assign a small amount of extra credit if you can only output each valid word once and another little bit of extra credit if you output these words in alphabetical order. You can only get the extra credit if your solution is 100% correct.
Sample Input Sample Output
2 Words Found Grid #1:
4 4 trap
Syrt part
gtrp cats
faaq Words Found Grid #2:
pmrc swing
5 6 wing
swingh letter
abcdef
rettel
ayzgfd
cmtydh
Specification Details You must use dynamic memory allocation to store the input dictionary and each individual word search grid. You must free your memory appropriately. You must read the input dictionary from the file dictionary.txt, which will be posted online.
Deliverables Please turn in a single source file, wordsearch.c, with your solution to this problem via Webcourses before the due date/time for the assignment. Make sure that your program reads the puzzles from standard in and outputs all information to standard out, as previously shown in lab. Note that the dictionary will be read in from a file.
Optimal capital structures
: Yet firms often issue debt at interest rates substantially below the yield that investors require on the firm's equity shares. Does this mean that such firms are not operating with optimal capital structures? Explain.
|
Project features of a software project deliverable
: Measuring and controlling project deliverables is essential to validating work performed within a project. Evaluate how project status reports are useful for measuring and controlling resource efforts, project schedules, project costs, and project fe..
|
Summarize the state of the negotiations and major issues
: Choose a current or recent labor contract (collective bargaining agreement) negotiation in the U.S. airline industry. Summarize the state of the negotiations, major issues, and resolution, if any.
|
Find the dimensional formula of e2e0hc
: Find the dimensional formula of e2/ε0hc
|
Standard in and outputs all information to standard out
: Given an input dictionary read in from a file to use for all test cases, and several word search grids, identify all words from the dictionary that appear in each word search grid.
|
How companies go about making decisions
: In class we discussed how companies go about making decisions related to important purchases. One method of making an informed purchasing decision is total value sometimes call life-cycle costing
|
Find the shaft speed nm for full-load conditions
: A 50-kW 440-V 50-Hz two-pole induction motor has a slip of 6 percent when operating at full-load conditions. At full-load conditions, the friction and windage losses are 520 W, and the core losses are 500W. Find the shaft speed nm for full-load ..
|
How is environmental scanning helpful in choosing
: How is environmental scanning helpful in choosing the appropriate metric guidelines to use?
|
Describe the encyclopedias as being a complete set
: ou quickly put an ad in your local newspapers, in which you describe the encyclopedias as being a complete set, only two years old, perfect condition, and that the buyer must buy the whole set.
|