Question: Write a function in C to find the common elements in two 2-D arrays A and B having dimensions m x n and p x

Write a function in C to find the common elements in two 2-D arrays A and B having dimensions m x n and p x q respectively and store them in a single dimensional array. Here, m is the number of rows and n is the number of columns in the two-dimensional array A. Similarly, p is the number of rows and q is the number of columns in the two-dimensional array B. Assume that there are no duplicate elements within the two-dimensional arrays A and B separately.

For Example: A[ ][3]= {{1, 2, 3), (4, 5, 6} }; // No Duplicate Elements B[ ][3]= ((7, 2), (4, 1}}; // No Duplicate Elements Resultant Array Containing Common Elements = (1,2,4} Note that the size of single dimension array will be minimum of m x n, p x q.

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!