Data Structures & AlgorithmsVery hardICPC regional · tree queries

Problem: Which problem does the 'LCA by Euler tour and RMQ' reduce to?

  1. A. Shortest path with negative edges
  2. B. Bipartite matching
  3. C. Range minimum query over depths
  4. D. Topological sort

Correct answer: C. Range minimum query over depths

The Euler tour records depths, and the LCA is the minimum-depth vertex in the range between two first occurrences.

More Coding Interview Problems questions

Exams that ask this topic