lowest_common_ancestor_problem (330B)
1 # Lowest common ancestor problem 2 3 Given two [nodes] in a [tree], find their [LCA] 4 5 A [tree] can be [preprocessed] in [linear_time] to support such queries in [constant_time], cf for instance https://en.wikipedia.org/wiki/Tarjan%27s_off-line_lowest_common_ancestors_algorithm 6 7 Up: [computational_problem], [lowest_common_ancestor]