Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
ds2-notes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
datovky
ds2-notes
Commits
b03bab92
Commit
b03bab92
authored
6 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
(a,b)-trees: Fix a couple of typos
parent
1fbf0e32
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
03-abtree/abtree.tex
+3
-3
3 additions, 3 deletions
03-abtree/abtree.tex
with
3 additions
and
3 deletions
03-abtree/abtree.tex
+
3
−
3
View file @
b03bab92
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment