I'm curious if you guys know an answer to this question that came to my mind.
We know that an average cost of BST insertion is O(log n)
and worst case as well as average for AVL/Splay is O(log n)
.
Since we are inserting n
times (basically we are building a tree) we will recieve the final cost being n*logn
.
How can we prove that we can't get lower than that? It's easy to observe but kind of hard to prove.
Maybe we can use recursive equations and somehow limit them?
Thanks in advance.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…