Question: void compare_with_each_row(int m[][N], int q[], int n) void compare_with_each_column(int m[][N], int q[], int n) can it be in programming language C, thanks 4. (20 pt)

 void compare_with_each_row(int m[][N], int q[], int n) void compare_with_each_column(int m[][N], int

void compare_with_each_row(int m[][N], int q[], int n)

void compare_with_each_column(int m[][N], int q[], int n)

can it be in programming language C, thanks

4. (20 pt) You are given an NxN 2D-array of integers (matrix) and a 1D-array of N integers (query). You are asked to write two functions to . compare the given ID array (query) with each row (left-to-rihtof the matrix . compare the given 1D array (query) with each column (top-to-bottom |) of the matrix If there is a match, these functions will print the matched row numbers and column numbers. Here is an example showing how the functions that you will implement in the next page can be used in main). suppose std C libraries are included here / fde fine N 4 /this number can be changed / main() int matrix [N] IN110, 10, 30, 45) 14, 10, 32, 11), 20, 30, 40, 50) 135 ,45, 25, 15) int query [N] int ii printf ("Enter ed integers to search in 2D array", N); printf ("Enter query [id] scanf("%d", &que ry [i]); ", i); = compare with each row matrix, query, N) compare with each column matrix, query, N); When the above program is executed, suppose a user enters 10 10 30 45 as the query Then the program should print: Row 0 is the same as query Column 1 is the same as query t/ void compare with each row (int m[ IN], int q, int n) / left-to-right

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!