Lowest Common Ancestor with Linking Roots

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 given on-line. Interspersed with the queries are on-line commands of the form link(x,y)link(x, y) where xx and yy are tree roots. 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
Harel, Tarjan [Linking Roots]1984O(n+ m*alpha(m + n, n)) where alpha is the inverse Ackermann functionO(n)
Modified van Leeuwen [Linking Roots]1976O(n+m*log(log(n)))O(n)

Reductions Table

Insuffient Data to display table

Other relevant algorithms

Insuffient Data to display table