Hi,
we can calculate the frequency of all element, Assign sort them in
increasing order of frequency.
then the first element of sorted list will be the return element.
0bn
we can implement it by Min Heap(which is based upon the frequency and
reorganise itself
as the frequency of element change
@Pankaj: Can you give more details of your algorithm, including the big-O
order of time and space. It certainly is not difficult to do it in O(n log
n) time and O(n) space, as this can be accomplished by a merge-sort. For
fixed data size, O(n) time and O(n) space can be achieved by a radix