Lowest Common Ancestor with Linking

Given a collection of rooted trees, answer queries of the form, "What is the nearest common ancestor of vertices xx and yy" In this version of the problem, the queries are on-line. Interspersed with the queries are on-line commands link(x,y)link(x, y) such that yy, but not necessarily xx, is a tree root. The effect of a command link(x,y)link(x, y) is to combine the trees containing xx and yy by making xx the parent of yy.

Parameters

  • nn: number of vertices
  • mm: number of total number of operations (queries, links, and cuts)

Filters

Computational Model

Randomization

Approximation

Algorithms Table

Displaying 2 of 2 algorithms

See more
Sleator and Tarjan [Linking]1983O(n+m*log(n))O(n)
Aho, Hopcroft, and Ullman [Linking]1976O((m+n)*log(n))O(n*log(n))

Reductions Table

Insuffient Data to display table

Other relevant algorithms

Insuffient Data to display table