What would be the datastructure in following scenorio?

Posted by Abhishek Jain on Stack Overflow See other posts from Stack Overflow or by Abhishek Jain
Published on 2010-04-10T17:39:55Z Indexed on 2010/04/10 17:43 UTC
Read the original article Hit count: 211

Filed under:

Please note that there is no limitation of memory. I need to insert int from 1 to 1000.

I can do the following operations in constant order of time: push(), pop() and getMax()

Please suggest me appropriate datastructure.

© Stack Overflow or respective owner

Related posts about datastructures