O(1) in both worst and best case, ONLY if we have a pointer to the location where the next element is to be inserted in the STACK. Thereby, if we have to push a new element into the stack, we execute
a[pointer++] = elementValue.;
To pop and element, we execute,
poppedValue = a[--pointer];
--
Altough unlikely, if we have lost the pointer that was used to keep track of the top element of the stack, then obviously we have to search for the top most element and then push element into the stack. Time Complexity in that case is O(n).
--
Hope I am right. :P