# Does amortized algorithm analysis make any assumptions about the sequence of function calls?

I have read that average case analysis makes some assumptions about the inputs to the data structure, and amortized analysis makes no such assumptions.

Does amortized analysis make any assumptions about the sequence of function calls to the data structure though?

I had had a dynamically sized stack (via an array) which only expanded the capacity by 1 element when it needed to expand the size, could I say that the amortized cost of this structure is $$O(n)$$ since I cannot guarantee that $$pop()$$ will ever be called?

Or should it still take $$pop()$$ into account therefore making an assumption about the sequence of function calls?

• No assumptions. May 8, 2020 at 5:26
• @YuvalFilmus thanks, in that case is my analysis of the stack correct?
– Joff
May 8, 2020 at 5:35
• You haven’t provided a complete analysis. To show that the amortized running time is large, all you need to do is give a bad sequence of operations. May 8, 2020 at 5:37
• right, which would cause a copy of every element and resize for every push and thus $O(n)$. Is that complete?
– Joff
May 8, 2020 at 5:47
• Recall that $O(n)$ is only an upper bound. You sequence of operations also takes $O(n!)$ time, but so what. You need a lower bound ($\Omega$) or a tight bound ($\Theta$). You also need to describe a complete sequence of $m$ operations with takes $Tm$ time, which will imply that the amortized running time is at least $T$. May 8, 2020 at 5:56