As I managed to understand, When we are dealing with some dynamic data structure which has an average cost of O(1) Amortized Analysis in push and pop operations like vector in c++, the vector takes constant time per each push till it reaches to the Nth push (N = current size reserved), in the Nth push it takes linear time to allocate a new space typically with double the old size, and pretty the same done in pop operations.
Now assume that we have a vector of N current reserved space with N — 1 elements, every time we push a new element into the vector then pop it again, is this done in a linear time to change the allocated space ? it seems not, but why ?