Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

What is American Polity and Governance ?

Answered: 1 week ago