since we have to visit each value at least once we have to do at least O(n)
steps so there cant be a solution in time less than o(n)
but if the range of the values is limited we can use another array to count
the number of occurrences of each value
and the complexity would be:
o(n) time
o(max of th
Hi,
Can anyone tell me what is the most efficient algo to find the mode.
Is it sorting and the then finding the max occurrence or can it be
done in time less than O(n) ?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, s