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

Abstract

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

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…