Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use C++ please Question // Header Files The current selected programming #includeciostream> language is CPP, We emphasize the #include submission of a fully working code

Use C++ please

image text in transcribed
Question // Header Files The current selected programming #includeciostream> language is CPP, We emphasize the #include submission of a fully working code & include over partially correct but efficient 6 using namespace std; code. Once submitted, you cannot review this problem again. You can 8 use cout to debug your code. The cout may not work In case of 10 * grid, represents the letters in the grid of size Nem. syntax/runtime error. The version of 11 word, represents the words to be searched of size K. GCC being used is 5.5.0. 12 13 void funcPuzzle (vector > grid, vectorsstrings word) 14 You are given a grid of letters, 15 followed by some words. The words // write your code here 16 can occur anywhere in the grid on a 17 row or a column, forward or 18 backwards. However, there are no 19 diagonal words. 20 int main() 21 Write an algorithm to find if the given 22 word occurs in the grid on a row or a //input for grid column, forward or backwards. 23 int grid_row; 24 int grid_col; Input 25 cin > > grid_row; The first line of input consists of two 26 cin > grid_col; 27 integers- grid row and grid col. representing the number of rows (N) 28 vectorevector > grid; and the number of columns (M) of 29 for ( int idx = 0: idx temp_vector; 32 separated characters representing for ( int jdx = 0; jdx temp; of words to be searched from the 35 temp_vector. push_back( temp ) : given grid (K). 37 38 The last line consists of K space- grid. push_back(temp_vector) ; The last line consists of K space- 37 separated strings representing the 38 grid. push_back( temp vector); words to search for in the grid. 39 40 Output 41 Print K space-separated strings 42 / / input for word consisting of "Yes" if the word is 43 int word_size present in the grid or "No" if the 44 cin >> word_size: word is not present in the grid. 45 vectorestrings word; 46 for ( int idx - 0; idx

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions