Question: Problem 1 . 4 ( 1 0 points ) : In image processing, sometimes it is necessary to convert an image ( a 2 D
Problem points : In image processing, sometimes it is necessary to convert an image a D array of pixels to a D array of pixels. If a is a array of size MxN we would like to convert it to a D array in row orderFor example. If you have a multidimensional array of three rows of four columns I would want to move the data, row by row, into a single array of length Make sure your code handles the general case and does not just show the example above. Complete the code below.
public static int flattenint a
if alength return null;
int rows length;
int cols length;
Fill in the code here
return tmp;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
