Data Structures19 sections · 729 units
Open in Course

Euler Tour Trees

Alternative approach

Euler Tour Trees (ETT) are another dynamic tree structure:

  • Store Euler tour of tree in a balanced BST
  • Link/cut by splicing tours
  • Subtree queries are range queries on tour

Comparison:

Link-CutETT
Path queryO(logn)O(\log n)Not native
Subtree queryComplexO(logn)O(\log n)
ImplementationHardMedium

ETT is better for subtree operations.

Link-Cut is better for path operations. Choose based on what queries you need.