Find Intersection of Two Arrays – Java Code

Given two sorted arrays, Write a java code to find intersection of two arrays.

For example, if the input arrays are:

arr1[] = {2, 3, 6, 7, 9, 11}
arr2[] = {4, 6, 8, 9, 12}

Then your program should print intersection as {6, 9}. Before writing actual code, let’s first discuss different approaches to solve this problem.

Move All Zeroes to the End of Array – Java Code

In this tutorial, We are going to discuss another interesting problem to move all zeroes to end of array. Given an array of random integers move all zeroes of a given array to then end of an array. The order of all other elements of an array should be same.

For example, if a given array is {1, 2, 0, 4, 0, 5, 3, 8}, than the output should be {1, 2, 4, 5, 3, 8, 0, 0}.

Stack Program in C using an Array – Stack Tutorial Part – I

Write a stack program in C using an array. Implement a stack data structure using an Array. In this tutorial, You are going to learn about stack data structure and it’s implementation in C using an array.

C Program to Implement a Stack using Linked List

What is a Stack Data Structure?

A Stack is a Data Structure, in which insertion and deletion operations are allowed only at one end. It worked on LIFO (Last In First Out) Principle. In LIFO, an element which inserted last must be the first element to be removed.