dsa1 min read
Sliding Window Maximum [Hard] — Monotonic Decreasing Deque
Find the maximum in every sliding window of size k in O(n) using a monotonic decreasing deque of indices.
Read →
webcoderspeed.com
2 articles
Find the maximum in every sliding window of size k in O(n) using a monotonic decreasing deque of indices.
Find the maximum in every sliding window of size k using a monotonic decreasing deque. O(n) solution that Google uses to test understanding of amortised data structures.