I wrote the push and pop operations for my stack. I'm trying to figure out what the worst case time complextiy is using asymptotic notation for these two operations is......i'm guessing Big O(log n)?..but i'm not sure..

Code:

void stack::push(int x){

if(size < 3){

top++;

stackArray[size] = x;

size++;

}

}

int stack::pop(){

int x = stackArray[top];

top--;

size--;

return x;

}