English

Exact (n + 2) Comparison Complexity for the N-Repeated Element Problem

Data Structures and Algorithms 2026-02-09 v2

Abstract

This paper establishes the exact comparison complexity of finding an element repeated nn times in a 2n2n-element array containing n+1n+1 distinct values, under the equality-comparison model with O(1)O(1) extra space. We present a simple deterministic algorithm performing exactly n+2n+2 comparisons and prove this bound tight: any correct algorithm requires at least n+2n+2 comparisons in the worst case. The lower bound follows from an adversary argument using graph-theoretic structure. Equality queries build an inequality graph II; its complement PP (potential-equalities) must contain either two disjoint nn-cliques or one (n+1)(n+1)-clique to maintain ambiguity. We show these structures persist up through n+1n+1 comparisons via a "pillar matching" construction and edge-flip reconfiguration, but fail at n+2n+2. This result provides a concrete, self-contained demonstration of exact lower-bound techniques, bridging toy problems with nontrivial combinatorial reasoning.

Keywords

Cite

@article{arxiv.2601.21202,
  title  = {Exact (n + 2) Comparison Complexity for the N-Repeated Element Problem},
  author = {Andrew Au},
  journal= {arXiv preprint arXiv:2601.21202},
  year   = {2026}
}
R2 v1 2026-07-01T09:24:55.158Z