Graph Theory37 sections · 1633 units
Open in Course

Common Mistakes

(Pitfalls to avoid)

Mistake 11: Forgetting to process the heavy child first during decomposition. This breaks the chain structure because nodes in the same chain will not get consecutive positions. Mistake 22: Including the LCA twice when merging the two paths from uu and vv.

The final segment should include the LCA only once. Mistake 33: Using the wrong segment tree range when querying chains. The order is pos[head[v]] <= pos[v] for all vv, with the head having the smaller position.