Analysis of Correctness and Running-Time
Understand the correctness proof and amortized running time of Scapegoat Tree operations. Learn how scapegoats are identified and how rebuilding affects performance, ensuring efficient add, remove, and find operations with detailed cost analysis.
We'll cover the following...
In this module, we analyze the correctness and amortized running time of operations on a ScapegoatTree.
Correctness
We first prove the correctness by showing that, when the add(x) operation results in a node that violates Condition (1 as discussed previously), then we can always find a scapegoat:
Lemma 1:
Let be a node of q in a ScapegoatTree. Then
there exists a node on the path from to the root such that.
Proof: Suppose, for the sake of contradiction, that this is not the case, and
for all nodes on the path from to the root. Denote the path from the root to as = . Then, we have ...