Given a Stack with n elements, write a method that always keeps the max of the stack?
Anonimo
Every data structure you may think of for say linked list or an array list etc.. gives us an O(n) runtime but if we create another stack and only push when a higher element comes in then that enables us to have O(1) runtime.