Data Structures & AlgorithmsVery hardICPC regional · number theory

Problem: What is the Stern-Brocot tree's relevance to competitive programming?

  1. A. It sorts strings
  2. B. It computes shortest paths
  3. C. It enumerates all positive rationals in lowest terms exactly once
  4. D. It counts prime factors

Correct answer: C. It enumerates all positive rationals in lowest terms exactly once

Each positive reduced fraction appears exactly once as a node of the Stern-Brocot tree.

More Coding Interview Problems questions

Exams that ask this topic