Repeating this analysis for each pair of rotations as we go up,
plus the final single rotation if needed, we get a total amortized
cost of , where the potential
function inequality is satisfied (string them all together).
Therefore, a splay operation in a tree of size n has an
amortized cost of . So, a sequence of k splays will cost
.