Concepts3
⚙️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
DFS - Tree and Graph Properties
Depth-First Search (DFS) assigns each vertex a discovery time and a finish time that capture a neat nesting structure of recursion.
#dfs#timestamps#discovery time+11
🗂️Data StructureIntermediate
Sparse Table
A Sparse Table is a static range-query data structure that preprocesses an array in O(n \log n) time and answers many queries in O(1) time.
#sparse table#range minimum query#rmq+12