0% found this document useful (0 votes)
36 views2 pages

SpecialAssignment1 PDF

Uploaded by

bleh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

SpecialAssignment1 PDF

Uploaded by

bleh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Special Assignment 1

Programming Problem
Data structures (CSE-A & D)
Deadline 15-10-19
Amanada, a school kid, is learning English alphabets. Her teacher devised a small game to make
the task fun. A grid of 'm' rows and 'n' columns is filled with English alphabets.
She needs to search English words in this grid by moving one step at a time in any of the adjacent
grid cells.
A grid of alphabets and a set of English words are given. Amanda can start from anywhere in the
grid and can move in any of the 8 adjacent grid cells, one step at a time. Each grid cell can only
be used once.

Input
You are given a template in which you need to implement a function whose signature is given
below.
C
int findWordInAGrid(char grid[128][128], int m, int n, char word[32])
/* return 0 for false, 1 for true. */
C++
bool findWordInAGrid(char grid[128][128], int m, int n, char word[32])

Output
The function should return true, if you can find the word in the grid and false otherwise.
Example
Let's consider the grid given below:
a b c
d e f
g h i
And set of words to be searched are:
abc
abedhi
efgh

Output:
The output of the above example should be:
abc: true
abedhi: true
efgh: false
Constraints
1 ≤ m,n ≤ 100

Submit your code at


(Keep your file name as RegistrationNo.doc/15123456.doc)
https://www.dropbox.com/request/jw4pjaFqjL0bVmIgoA3H

You might also like