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

  Statistics-probability assignment

MATH1550H: Assignment:  Question:  A word is selected at random from the following poem of Persian poet and mathematician Omar Khayyam (1048-1131), translated by English poet Edward Fitzgerald (1808-1883). Find the expected value of the length of th..

  What is the least number

MATH1550H: Assignment:  Question:     what is the least number of applicants that should be interviewed so as to have at least 50% chance of finding one such secretary?

  Determine the value of k

MATH1550H: Assignment:  Question:     Experience shows that X, the number of customers entering a post office during any period of time t, is a random variable the probability mass function of which is of the form

  What is the probability

MATH1550H: Assignment:Questions: (Genetics) What is the probability that at most two of the offspring are aa?

  Binomial distributions

MATH1550H: Assignment:  Questions:  Let’s assume the department of Mathematics of Trent University has 11 faculty members. For i = 0; 1; 2; 3; find pi, the probability that i of them were born on Canada Day using the binomial distributions.

  Caselet on mcdonald’s vs. burger king - waiting time

Caselet on McDonald’s vs. Burger King - Waiting time

  Generate descriptive statistics

Generate descriptive statistics. Create a stem-and-leaf plot of the data and box plot of the data.

  Sampling variability and standard error

Problems on Sampling Variability and Standard Error and Confidence Intervals

  Estimate the population mean

Estimate the population mean

  Conduct a marketing experiment

Conduct a marketing experiment in which students are to taste one of two different brands of soft drink

  Find out the probability

Find out the probability

  Linear programming models

LINEAR PROGRAMMING MODELS

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