Dynamic Programming21 sections · 916 units
Open in Course

Vocabulary - Li Chao Tree

Alternative structure

A Li Chao tree is a segment tree over the range of possible xx values. Each node stores one line. Insert: Compare new line with stored line at the midpoint.

Keep the one that wins at midpoint. Recurse with the other line to the half where it might win. Query: Walk from root to leaf at xx. Return the best value seen. Both operations: O(logn)O(\log n). Works for arbitrary slopes and arbitrary queries. It's the most general CHT data structure.