Advanced Trees

  • Segment tree = dynamic range queries
  • Sparse table = static range queries
  • Interval tree = interval overlap lookup
1 / 4

Segment tree

  • Build O(n)
  • Query/update O(log n)
  • Supports min/max/sum/gcd
2 / 4

Sparse table

  • Precompute blocks of size 2^k
  • Query min in O(1)
  • Works for idempotent ops
3 / 4

Interval tree

  • Store max end in subtree
  • Stabbing and overlap queries
4 / 4
Use arrow keys or click edges to navigate. Press H to toggle help, F for fullscreen.