单选题:A $n$-nodes AVL tree $T$ performs insertion or deletion in the w
A $n$-nodes AVL tree $T$ performs insertion or deletion in the worst case that costs $a_0 \lg n + b_0$, $a_1 \lg n + b_1$, respectively, where $a_0, a_1, b_0, b_1$ are constants. Now, we start from an empty tree, perform a sequence of $n$ insertions or deletions in the AVL tree. To analysis the amortized cost per insertion or deletion, we define a potential function $\Phi(T) = a_1 \sum_{i=1}^{n} \lg i$. What is the amortized cost per insertion or deletion?
A.$O(\lg n )$ for insertion $O(\lg n)$ for deletion
B.$O(\lg n )$ for insertion $O(1)$ for deletion
C.$O(1)$ for insertion, $O(\lg n)$ for deletion
D.$O(1)$ for insertion, $O(1)$ for deletion
答案:B
A.$O(\lg n )$ for insertion $O(\lg n)$ for deletion
B.$O(\lg n )$ for insertion $O(1)$ for deletion
C.$O(1)$ for insertion, $O(\lg n)$ for deletion
D.$O(1)$ for insertion, $O(1)$ for deletion
答案:B