Matching nuts and bolts faster

Noga Alon, Phillip G. Bradford, Rudolf Fleischer*

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review


The problem of matching nuts and bolts is the following: Given a collection of n nuts of distinct sizes and n bolts such that there is a one-to-one correspondence between the nuts and the bolts, find for each nut its corresponding bolt. We can only compare nuts to bolts. That is we can neither compare nuts to nuts, nor bolts to bolts. This humble restriction on the comparisons appears to make this problem very hard to solve. In fact, the best explicit deterministic algorithm to date is due to Alon et al. (1994) and takes Θ(n log4) time. In this paper, we give a simpler O(n log2 n) time algorithm. The existence of an O (n log n) time algorithm has been proved recently (Bradford, 1995; Komlós et al., 1996).

Original languageEnglish
Pages (from-to)123-127
Number of pages5
JournalInformation Processing Letters
Issue number3
StatePublished - 12 Aug 1996


  • Analysis of algorithms
  • Nuts and bolts
  • Sorting


Dive into the research topics of 'Matching nuts and bolts faster'. Together they form a unique fingerprint.

Cite this