find most common element

Programs to Find Most Common Element in an Unsorted Array

Given an unsorted array as an input, the goal is to find most common element or most frequent element or most repeating element in the array. Let’s solve this problem using the following methods i.e., Method 1: Sorting and Linear Traversal and Method… Read More!

find common elements

Programs to Find Common Elements between Two Unsorted Arrays

Given set of two unsorted arrays as input, the goal is to find common elements between them in an efficient way. Let’s solve this problem using the following methods i.e., Method 1: Iterative approach, Method 2: Using HashSet and Method 3:… Read More!

remove duplicates

2 Ways to Remove Duplicates from Sorted Array – O(n) time

Given an input array of integers, your goal is to remove duplicates present from an sorted array in O(n) time by method 1: using extra space i.e., O(n) space and by method 2: using constant space i.e., O(1) space. Method 1:… Read More!