Do a sequence of inserts, then traverse the resulting tree.
Running time: Clearly
.
We will see, in fact, that any sequence of k splays on a tree
with n nodes runs in
.
We will use amortized analysis to show this.
Therefore, what is splay sort's running time?