Showing posts with label interview. Show all posts
Showing posts with label interview. Show all posts

Sunday, September 18, 2011

How to find min of a stack in o(n)

Original stack 3,4,6,2,8,1,9
Maintain a stack 3,3,3,2,2,1,1