← Back to Games

🏔️ Peak Spotter Window

Sliding Window Maximum — Using Deque (Monotonic)

Array Elements
Maximum of Each Window (Result)
Run algorithm to see results...
🎮 Controls
📊 Deque State
Stores indices of potential max elements (decreasing order)
Empty
💡 Algorithm
1. Maintain deque in decreasing order
2. Remove indices outside window
3. Remove smaller elements from back
4. Front always has max for window