Find Common Elements in Two Arrays – Intersection of two Arrays

Write a c program to find common elements in two arrays.

Given two positive integer arrays arr1 and arr2 of lengths len1 and len2. We have to write a c code to find intersection of these two arrays. Both the arrays are sorted.

Let’s assume we have following two sorted arrays arr1 and arr2.

int arr1[] = {2,  3,  4,  5,  6};
int arr2[] = {4,  6,  7,  8,  9};

So the common elements in these two arrays is 4 and 6.

Find Common Elements in Two Arrays

MCQ on Stack and Queue – Data Structure Practice Questions

MCQ on stack and queue data structure. Both Stack and Queue data structure is very important in computer science. In this tutorial, you are going to learn about stack and queue data structure. Also you’ll find MCQ on stack and queues.

In my previous post, i have discussed how to implement stack and queue data structure.

Stack program in C using Array.

Queue data structure and their implementation.

The purpose of this objective questions is to test how well you understand the concept of stack and queue.