I was practicing this question for an Interview .
Best data structure that will implement the following 3 operation in minimum time::
a.) insertion.
b.) removing the oldest element.
c.) printing the largest element.
The Best that, i can think of is a Min/Max Heap or a priority Queue. For operation (a) and (c) ,Heap is efficient but, I am not sure, the second operation 'removing the oldest element' can be done efficiently using Heap.
So Suggest an ideal data Structure that will implement all 3 operation efficiently.
Thanks!