[algogeeks] Re: Linear for push, pop and min()?
Yeah, looks very good! Thank you. :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send em
[algogeeks] Re: Linear for push, pop and min()?
You can do this using two stacks --- Stack s, m; Push(x): s.push(x) if(x > m.top()) m.push(m.top()) else m.push(x) Pop(): m.pop() return