Standard in and outputs all information to standard out

Assignment Help Basic Statistics
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.

Reference no: EM13967568

Questions Cloud

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.

Reviews

Write a Review

Basic Statistics Questions & Answers

  The number of pounds of steam used per month by a chemical

the number of pounds of steam used per month by a chemical plant is thought to be related to the average ambient

  From a box containing 4 dimes and 2 nickels 3 coins are

from a box containing 4 dimes and 2 nickels 3 coins are selected at random without replacement. find the probability

  Computing expected values and decision making

There is a probability that the river will flood next year. Riverside's profits for the coming year depend on whether Laura buys the flood insurance and whether the river floods.

  Write out the null and the alternative hypothesis what is

the national center for health statistics reports that the mean systolic blood pressure for males 3 to 44 years of age

  Percentage of light bulbs having life

If light bulbs have lives that are normally distributed with a mean of 2500 hours and a standard deviation of 500 hours, what percentage of light bulbs have a life less than 2500 hours?

  Independent samples t test or related samples t test

Should Martha use an independent-samples t-test or a related samples t-test? Explain your answer.

  What is the probability that a good machine will be

an automatic welding machine is being considered for production. it will be considered for purchase if it is successful

  Assuming that the numbers you received were generated at

four possibly winning numbers for a lottery-ab-4536 nh-7812 sq-7855 and zy-3221- arrive in the mail. you will win a

  Difference between confidence interval and significance leve

Please explain the difference between confidence interval and significance level and how they interact or "influence" each other.

  What is distribution variability and how is it linked to

what is distribution variability and how is it linked to accuracy of statistical

  Same number of products and same brands

In February 2002, the Argentine peso lost 70% of its value compared to the United States dollar. This devaluation drastically raised the price of imported products.

  A soda company wants to stimulate sales in this economic

a soda company wants to stimulate sales in this economic climate by giving customers a chance to win a small prize for

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd