We consider the problem of finding the mode (an element that appears the maximum number of times) in a list of elements that are not necessarily from a totally ordered set. Here, the relation between elements is determined by ‘equality’ comparisons whose outcome is = when the two elements being compared are equal and ≠ otherwise. In sharp contrast to the Θ(n lg n/m) bound known in the classical three way comparison model where elements are from a totally ordered set, a recent paper gave an O(n2/m) upper bound and Ω(n2/m) lower bound for the number of comparisons required to find the mode, where m is the frequency of the mode. While the number of comparisons made by the algorithm is roughly n2/m, it is not clear how the necessary bookkeeping required can be done to make the rest of the operations take Θ(n2/m) time. In this paper, we give two mode finding algorithms, one taking at most 2n2/m comparisons and another taking at most 3n2/2m + O(n2/m2) comparisons. The bookkeeping required for both the algorithms are simple enough to be implemented in O(n2/m) time. The second algorithm generalizes a classical majority finding algorithm due to Fischer and Salzberg.
CITATION STYLE
Jayapaul, V., Raman, V., & Satti, S. R. (2016). Finding mode using equality comparisons. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 9627, pp. 351–360). Springer Verlag. https://doi.org/10.1007/978-3-319-30139-6_28
Mendeley helps you to discover research relevant for your work.