wiki_research

personal research wiki
git clone https://a3nm.net/git/wiki_research/
Log | Files | Refs

lowest_common_ancestor_problem (318B)


      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]
      6 - cf https://en.wikipedia.org/wiki/Tarjan%27s_off-line_lowest_common_ancestors_algorithm
      7 
      8 Up: [computational_problem], [lowest_common_ancestor]