report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
Module Heavy-light decomposition

Heavy-light decomposition

**Frequency: 2/10** ~~A wise man once said, if a data structure problem is not challenging enough, then throw it onto a tree.~~ HLD can be used to solve problems involving query on a path, enabling the use of some data structures like Segment Tree or BIT on the path.

Resources

- [CP Algorithms: Heavy-light decomposition](https://cp-algorithms.com/graph/hld.html)

Problems

Path queries 333 / 339 1800
Packages 220 / 231 1900
Greatest subarray sum on tree 158 / 190 2000
Chongqing Megacity 78 / 80 2000

Data structure

  • Sweep Line
  • Introduction to Trie
  • Square root decomposition

Tree

  • Rerooting
  • Small-to-large
  • Heavy-light decomposition

Graph

  • Strongly connect component
  • Articulation point and bridge
  • Bipartite Matching

Dynamic Programming

  • Digit DP
  • Matrix multiplication

Hashing

  • Hash a set

Others

  • Divide and conquer

Geometry

  • Geometry

Binary search

  • Parallel binary search

Others

  • Additional Problems (Level 5)