Finding the max repeated element in an array
Problem : Find the element which occurs maximum number of times.
METHOD 1 : Sorting the array and scanning the array
The simple solution is to
Sort the array Scan the array such that keep the track of the elements which occurred max number of times METHOD 2 : Using Binary Search Tree
We can have a binary search tree with an extra field count, which indicates the number of times an element appeared in the input.
[Read More]