Domanda di colloquio di Stratoscale

implement a stack that also soppurt finding the min in o(1) time.

Risposta di colloquio

Anonimo

23 lug 2018

hold two stacks, regular one and one that only keep the min for that time. when pop from the original stack, pop it also from the mn stack if it the same element.