Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Searching in 2D Grid(c++)
Chetan Malhotra
Jun 23 2016 4:21 PM
398
Reply
Please take a look: http://www.geeksforgeeks.org/search-a-word-in-a-2d-grid-of-characters/
This is a C++ program that searches a 2D grid for a particular word.
In, the code, there are two declarations:
int x[]={-1,-1,-1,0,0,1,1,1};
int y[]={-1,0,1,-1,1,-1,0,1};
Can anyone please explain these?? The author says these are for searching in all the 8 directions. But i am not getting how??
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How to Read and Write Collections custom types to file with custom file extension
Passing a pointer to an array to an external function