Is there a class in Java that implements the concept of Stack form the data structure books, means LIFO, pop is O(1) and push in O(1)?
I read a bit the code of java.util.Stack and it is doesn't seems that push is O(1) - push can call Vector.grow() and it can take O(n) ( I know it amortized O(1) but I looking for always push in O(1) )
And I want to understand why java.util.Stack was designed as is, not as the theoretical principle of stack
