Comparison tournament

ID: comparison-tournament

Pair candidates from a totally ordered set and retain the greater one from each comparison until one winner remains. Every other candidate loses once, so key comparisons suffice to find the maximum of distinct values. A balanced tournament on inputs gives the winner direct losers. Retaining each loser's own defeat record preserves information for finding later order statistics. The comparison records form a rooted tree and are distinct from a graph-theoretic tournament, which includes a directed comparison between every pair.

New to topics? Read the docs here!