Concepts2
🗂️Data StructureAdvanced
Top Tree
Top trees are dynamic tree data structures that represent a forest as a hierarchy of clusters, allowing O(log n) amortized time for link, cut, path queries/updates, and many subtree queries.
#top tree#dynamic tree#link cut+12
⚙️AlgorithmIntermediate
Two Pointers
Two pointers is a pattern where two indices move through a sequence in a coordinated, usually monotonic way to avoid unnecessary work.
#two pointers#sliding window#opposite ends+12