Create a two-d array puzzle that will find the given words

Assignment Help Data Structure & Algorithms
Reference no: EM131184898

Create a 2d array puzzle that will find the following words; this, two,fat,that.

/word puzzle with 3 rows and 3 columns

#include <iostream>
#include <cstring>

using namespace std;

#define R 3
#define C 3

string puzzle []={};

int c = sizeof(puzzle)/sizeof(puzzle[0]);

bool isword(string & string)

{
for (inti=0; i<c; i++)
if (string.compare(puzzle[i])== 0)
return true;
return false;
}
void findwordUtil(char puzzle[R][C], bool visited [R][C], inti, int j, string & string)

visited[i][j] = true
string = string + puzzle[i][j];

if (isWord(string))
cout<< string<<endl;
for (int row=i-1; row<=i&& row<R; row++)
for (int collate=j-1 && row<C; collate++)
if (row>=0 && collate>=0 && ! visited[row][collate])
findWordsUtil(puzzle, visited, row, collate, string);
string.erase(string.length()-1);
visited[i][j]=false;
}
void findWords(char puzzle[R][C] = {{false}};
string string = "";

for (int j=0; j<C; j++)
findWordsUtil(puzzle, visited, i.j. string);{{t,y,i,s}}
{{w,a,t,s}}
{{o,a,h,g}}
{{f,g,d,t}}

cout<< "words in the puzzle\n";
findWords(puzzle);
return 0;

}

Reference no: EM131184898

Questions Cloud

Investigate the effectiveness of business information system : Investigate the effectiveness of business information systems of the given case study. To do this, you are required to submit a complete report which includes an analysis of functionality.
Explain why you agree or disagree with the above statement : Explain why you agree or disagree with the above statement. Focus on employee-related regulations established by the United States, such as the Department of Labor, the U.S. Equal Employment.
Why should workplace smoking bans : Why should workplace smoking bans be particularly influential in affecting the behavior of people who work long hours?
Us produce only about a quarter of worlds greenhouse gases : Explain how this can be so when the United States produces only about a quarter of the world's greenhouse gases.
Create a two-d array puzzle that will find the given words : Create a 2d array puzzle that will find the following words; this, two,fat,that. void findwordUtil(char puzzle[R][C], bool visited [R][C], inti, int j, string & string)
What real world data would you want to examine : What would you consider to be evidence of tit-for-tat pricing? How can you distinguish tit-for-tat pricing designed to sustain "collusive" pricing from competitive pricing?
Are there factors that might reverse this implication : Are there factors that might reverse this implication? That is, can you think of reasons why the attractiveness of deviating from cooperative pricing might actually be greater during booms (high demand) than during busts (low demand)?
How would you empirically test given argument : Some observers argue that since CO2 and temperature levels have been much higher in Earth's history than they are today,- How would you empirically test this argument?
Identify one or more experience goods : Identify one or more experience goods. Identify one or more search goods. How does the retailing of experience goods differ from the retailing of search goods? Do these differences help consumers?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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