辅助栈和数据栈不同步 (1)辅助栈为空的时候,必须放入新进来的数; (2)新来的数小于或者等于辅助栈栈顶元素的时候,才放入,特别注意这里“等于”要考虑进去,因为出栈的时候,连续的、相等的并且是最小值的元素要同步出栈; (3)出栈的时候,辅助栈的栈顶元素等于数据栈的栈顶元素,才出栈。 总结一下:出栈时,最小值出栈才同步;入栈时,最小值入栈才同步。 @param x
(int x)
source not stored for this graph (policy: none)
nothing calls this directly
no outgoing calls
no test coverage detected