Suppose such a data structure existed.
Then here is an O(n) comparison-based sorting algorithm:
- Push() every item into this data structure.
- Pop() them all off in sorted order.
No O(n) comparison-based sorting algorithm can exist, therefore no such data structure can exist.
solved How to design a data structure which supports the following operations in constant time?