Concepts2
⚙️AlgorithmAdvanced
Matrix Exponentiation - Advanced
Matrix exponentiation turns repeated linear transitions into fast O(n^{3} log k) computation using exponentiation by squaring.
#matrix exponentiation#adjacency matrix#walk counting+12
⚙️AlgorithmIntermediate
DP on Trees
DP on trees is a technique that computes answers for each node by combining results from its children using a post-order DFS.
#tree dp#post-order dfs#rerooting+12