Frage im Vorstellungsgespräch bei Microsoft

Implement stack that holds minimum

Antwort im Vorstellungsgespräch

Anonym

1. Feb. 2019

Stack has global minimum, each node has minimum. Whenever you push node, nodes minimum = stacks global minimum. That way when you pop, the stacks global minimum = min(top node min, stack min)