Question DSA-QUE-0018
HardWhich data structure gives O(1) access to the maximum of the last k elements of a stream as it slides?
- A.
A monotonic deque
- B.
A stack
- C.
A plain queue
- D.
A linked list
Sign up free to see the answer and a step-by-step explanation.