30, the function stack comprising min

1, Title Description:

  Stack data structure definition, implement a function can be obtained min smallest elements contained in the stack (should the time complexity O (. 1)), the call type min, Push, pop time complexity is O ( 1).

2, thinking:

  

Guess you like

Origin www.cnblogs.com/guoyu1/p/12143402.html