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.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Queues and Deques question
Which data structure gives O(1) access to the maximum of the last k elements of a stream as it slides?
A monotonic deque
A stack
Sign up free to see the answer and a step-by-step explanation.
A plain queue
A linked list