Concepts18

⚙️AlgorithmAdvanced

Virtual Tree (Auxiliary Tree)

A Virtual Tree (Auxiliary Tree) compresses a large tree into a much smaller tree that contains only the k important nodes and the LCAs needed to keep them connected.

#virtual tree#auxiliary tree#lca+12
⚙️AlgorithmIntermediate

Lowest Common Ancestor (LCA)

The Lowest Common Ancestor (LCA) of two nodes in a rooted tree is the deepest node that is an ancestor of both.

#lowest common ancestor#binary lifting#euler tour+12
⚙️AlgorithmIntermediate

Minimum Spanning Tree - Prim

Prim's algorithm builds a Minimum Spanning Tree (MST) by growing a tree from an arbitrary start vertex, always adding the lightest edge that connects the tree to a new vertex.

#prim#minimum spanning tree#mst+12
🗂️Data StructureAdvanced

HLD - Path Queries and Updates

Heavy-Light Decomposition (HLD) breaks a tree into a small number of vertical chains so any path (u,v) becomes O(log n) contiguous segments in an array.

#heavy light decomposition#hld#path query+12
🗂️Data StructureIntermediate

Iterative Segment Tree

An iterative segment tree stores all leaves in tree[n..2n-1] and internal nodes in tree[1..n-1], enabling O(\log n) point updates and range queries without recursion.

#iterative segment tree#segment tree#non-recursive+12
🗂️Data StructureIntermediate

Trie (Prefix Tree)

A trie (prefix tree) stores strings or bit-sequences so that common prefixes share nodes, making operations depend on the key length L rather than the set size.

#trie#prefix tree#autocomplete+12