Pregunta de entrevista de Sumo Logic

Design a datastructure that does an insert,delete,find minimum in constant time.

Respuesta de la entrevista

Anónimo

7 de abr de 2019

Can you describe a little more. One solution achieves this using 2 stacks? - one stack to push and pop elements - another stack to keep pushing the minimum element, as the new elements are pushed, and pop out when the 1st stack element is popped