Concepts2
🗂️Data StructureAdvanced
Centroid Decomposition
Centroid decomposition splits a tree around a special node (centroid) so that every remaining component has at most half the nodes.
#centroid decomposition#centroid tree#tree algorithms+11
🗂️Data StructureIntermediate
Monotonic Deque
A monotonic deque is a double-ended queue that keeps elements in increasing or decreasing order so that the front always holds the current optimum (min or max).
#monotonic deque#sliding window maximum#sliding window minimum+12