Data Structures19 sections · 729 units
Open in Course

Space Complexity

Memory usage

Link-Cut trees use O(n)O(n) space:

  • nn nodes, each with constant fields
  • No edge storage needed (edges implicit in parent pointers)
  • Lazy flags and aggregates add constant overhead per node

Compare to other structures:

  • HLD: O(n)O(n) with segment trees included
  • Euler tour: O(n)O(n) for tour, segment tree adds O(n)O(n)
  • Link-Cut: O(n)O(n) total

Link-Cut trees are space-efficient despite their power.