Type of work: Individual work You are given an nxn matrix. Find if it has a visual 'envelope' pattern. First input is n, remaining numbers are the binary matrix content. Result should be 1 or 0...


Type of work: Individual work<br>You are given an nxn matrix. Find if it has a visual 'envelope' pattern. First input is n, remaining numbers are the binary matrix content. Result should be 1 or 0 (envelope or not, respectively).<br>By envelope, we mean, boundary, diagonal and anti-diagonal are set to 1, others are set to 0. You should use at most 6 loops (utilize functions), otherwise there may be grade reductions. Your<br>solution should work for any n; it should be generalizable. So, use malloc to allocate multi-dimensional array. If the input is<br>11111<br>11011<br>10101<br>11011<br>11111<br>the result should be 1<br>If the input is<br>5<br>10101<br>11011<br>10101<br>11010<br>10111<br>the result should be 0 (boundaries are not set to 1).<br>1<br>0 0 0<br>Below are the examples of diagonal and anti-diagonal of a matrix. 0<br>1<br>0 0 1<br>1<br>1<br>0 0 0<br>1<br>1<br>

Extracted text: Type of work: Individual work You are given an nxn matrix. Find if it has a visual 'envelope' pattern. First input is n, remaining numbers are the binary matrix content. Result should be 1 or 0 (envelope or not, respectively). By envelope, we mean, boundary, diagonal and anti-diagonal are set to 1, others are set to 0. You should use at most 6 loops (utilize functions), otherwise there may be grade reductions. Your solution should work for any n; it should be generalizable. So, use malloc to allocate multi-dimensional array. If the input is 11111 11011 10101 11011 11111 the result should be 1 If the input is 5 10101 11011 10101 11010 10111 the result should be 0 (boundaries are not set to 1). 1 0 0 0 Below are the examples of diagonal and anti-diagonal of a matrix. 0 1 0 0 1 1 1 0 0 0 1 1

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here