♠ Posted by GeekyFry in algorithm,amazon-interview-question,data-structures,google-interview-question,interview,microsoft-interview-question,programming,stack,tech-it at 8:35 PM

Implement a data structure similar to a stack that supports the following operations as efficiently as possible:

- Push, which adds a new element atop the stack,
- Pop, which removes the top element of the stack,
- Find-Max, which returns (but does not remove) the largest element of the stack, and
- Find-Min, which returns (but does not remove) the smallest element of the stack, and

What would be the fastest implementation of this data structure?

## 0 comments:

## Post a Comment