Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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-rightStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started