What is Heavy-Light Decomposition and when is it used in tree-based problems?
Heavy-Light Decomposition is used to split a tree into subtrees and apply dynamic programming to solve path queries more efficiently.
Thatâ€™s partially correct. Heavy-Light Decomposition splits a tree into heavy and light paths, not subtrees, and is typically used for optimizing path queries.
Can you clarify the difference between subtrees and heavy/light paths in the context of decomposition?