Data Structures & AlgorithmsVery hardICPC regional · number theory

Problem: Which structure gives the best rational approximations to a real number in a tree form?

  1. A. A binary heap
  2. B. A suffix tree
  3. C. A Fenwick tree
  4. D. The Stern-Brocot tree

Correct answer: D. The Stern-Brocot tree

Each node of the Stern-Brocot tree is a fraction, and the path from the root gives continued-fraction approximations.

More Coding Interview Problems questions

Exams that ask this topic