What do you mean by monotonic queue?
Monotonic queue is a data structure where the data is entirely in non-decreasing order or entirely in non-increasing order. It is generally used for optimizing dynamic programming techniques. Monotonic queues can be used to solve problems that require us to find the greater/min/max till a particular window. We have explained the idea with 2 problems:
Daily Temperatures problemLargest Rectangle in HistogramImplementing non-increasing and non-decreasing mon...
Published on April 21, 2021 00:08