Рет қаралды 11,629
In this episode, I talk about RMQs, as well as some things you can use them for, including getting the LCA in a tree in O(1), and building RMQs in O(n) with O(1) queries.
Time stamps below:
Intro: 0:00
Sparse tables: 0:25
RMQ use cases: 6:30
O(1) LCA: 7:30
Example Problem of Binary Searching an RMQ: 10:27
RMQs in O(n) precomp/memory, O(log(n)) query: 13:30
Runtime comparison to Segment Trees: 19:10
Handling small range queries on O(1): 20:30
When not to use the O(n)/O(1) RMQ: 29:26
If you have any questions, I'll make a CF blog where you can post them and I'll answer them there. Enjoy!