I was wondering, if instead of using a deque for our currentwindow variable, we used a MaxHeap, where we just store the values, would the runtime then be O((n-k+1)* 2log(w))? Since for every window we would be inserting the new value and removing the old value from the heap? Simplifies to O(nlog(w)).
Just wanted to make sure/ check my answer/understanding
Course: Grokking Coding Interview Patterns in JavaScript - Learn Interactively
Lesson: Find Maximum in Sliding Window - Grokking Coding Interview Patterns in JavaScript