Concepts2
⚙️AlgorithmAdvanced
Convex Hull Trick - Dynamic (LineContainer)
Dynamic Convex Hull Trick (LineContainer) maintains the lower or upper envelope of lines y = m x + b with O(log n) insertion and O(log n) query for arbitrary insertion order.
#convex hull trick#dynamic cht#linecontainer+12
⚙️AlgorithmAdvanced
Convex Hull Trick (CHT)
The Convex Hull Trick (CHT) speeds up dynamic programs where each state is a minimum over linear functions, such as dp[i] = min_j (dp[j] + b[j] × a[i]).
#convex hull trick#cht#dynamic programming optimization+12