Problem Statement: Consider a matrix of size N x N comprising of numbers 0 or 1.
ID: 3631247 • Letter: P
Question
Problem Statement: Consider a matrix of size N x N
comprising of numbers 0 or 1. Given such a matrix,
problem is to find the location of a given pattern. For
example, if the pattern to be searched is as follows:
X 0 0 1
0 X 0 0
X X 0 1 (X: don’t care could be 0 or 1)
then your program should identify ALL occurrences of the
above similar patterns in the entire matrix. Typical output
from your program should be displayed as follows:
=======================
Output and Statistics:
Pattern 1 found at the following location(s):
(1,4), (5,8), ….(100,605),…
Number of patterns found: 73
Time Taken: 0.000234secs
======
Pattern 2 found at the following location(s):
4
(11,4), (15,81), ….(200,201),…
Number of patterns found: 12
Time Taken: 0.000012secs
=======
Pattern 3 found at the following location(s):
NIL
Number of patterns found: 0
Time Taken: 0.0000001secs
…
======
Search completed!
Statistics:
Most popular pattern: counts> (If you have more than one display them all)
Least popular pattern: counts>(If you have more than one display them all)
Total time taken: 0.083456 secs
Explanation / Answer
Ok rate me as lifesaver first. Im tired of doing all the work and then finding out the person just takes my answer and doesnt rate the question. Once you have rated it just inbox me for the answer.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.