Skip to content
Snippets Groups Projects
Commit b03bab92 authored by Martin Mareš's avatar Martin Mareš
Browse files

(a,b)-trees: Fix a couple of typos

parent 1fbf0e32
Branches
No related tags found
No related merge requests found
......@@ -105,7 +105,7 @@ Therefore in each tree, we have $n \le b^h-1$, so $h \ge \log_b (n+1)$.
\subsection{Searching for a~key}
$\alg{Find}(x)$ follows the general algorithm for multi-way trees.
It visits $\O(\log_a n) = \O(\log n/\log a)$ nodes. In each node, it compares~$x$ with
It visits $\O(\log_a n)$ nodes, which is $\O(\log n/\log a)$. In each node, it compares~$x$ with
all keys of the node, which can be performed in time $\O(\log b)$ by binary search.
In total, we spend time $\Theta(\log n \cdot \log b / \log a)$.
......@@ -175,7 +175,7 @@ sibling is large, we can fix our problem by borrowing a~key from it.
Let us be exact. Suppose that we have an undersized node~$v$ with
$a-2$ keys and this node has a~left sibling~$\ell$ separated by a~key~$p$ in their
common parent. If there is no left sibling, we use the right sibling and follow
A~MIRROR image of the procedure.
a~mirror image of the procedure.
If the sibling has only~$a$ children, we merge nodes~$v$ and~$\ell$ to a~single
node and we also move the key~$p$ from the parent there. This creates a~node with
......@@ -290,7 +290,7 @@ performs $\O(m)$ node modifications.}
\proof
We define the cost of an~operation as the number of nodes it modifies.
We will show that there exists a~potential~$\Phi$ such that the amortized cost
of splitting and merging with respect to~$\Phi$ is at most~0 and the amortized
of splitting and merging with respect to~$\Phi$ is zero or negative and the amortized
cost of the rest of \alg{Insert} and \alg{Delete} is constant.
The potential will be a~sum of node contributions. Every node with $k$~keys
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment