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
3a9cc9de
Commit
3a9cc9de
authored
4 years ago
by
Václav Končický
Browse files
Options
Downloads
Patches
Plain Diff
Dynamization: Spellchecking and bibliography
parent
b2eb347c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
bib/bibliography.bib
+11
-0
11 additions, 0 deletions
bib/bibliography.bib
vk-dynamic/dynamic.tex
+9
-9
9 additions, 9 deletions
vk-dynamic/dynamic.tex
with
20 additions
and
9 deletions
bib/bibliography.bib
+
11
−
0
View file @
3a9cc9de
...
...
@@ -8,3 +8,14 @@
isbn
=
"978-80-239-9049-2"
,
url
=
"http://mj.ucw.cz/vyuka/ga/"
}
@book
{
km:dsa3
,
author
=
"Kurt Mehlhorn"
,
title
=
"{Data Structures and Algorithms 3}"
,
series
=
"{EATCS Monographs on Theoretical Computer Science}"
,
volume
=
3
,
year
=
1984
,
publisher
=
"{Springer, Berlin, Heidelberg}"
,
isbn
=
"978-3-642-69900-9"
,
url
=
"http://people.mpi-inf.mpg.de/~mehlhorn/DatAlgbooks.html"
}
This diff is collapsed.
Click to expand it.
vk-dynamic/dynamic.tex
+
9
−
9
View file @
3a9cc9de
...
...
@@ -92,7 +92,7 @@ $BB[\alpha]$ trees.
Rebuilding a subtree
$
T
(
v
)
$
takes
$
\O
(
s
(
v
))
$
time, but we can show that this
happens infrequently enough. Both insertion and deletion change the amount of
nodes by one. To
i
nbalance a root of a perfectly balanced trees, and thus cause
nodes by one. To
u
nbalance a root of a perfectly balanced trees, and thus cause
a rebuild, we need to add or remove at least
$
\Theta
(
n
)
$
vertices. We will
show this more in detail for insertion.
...
...
@@ -208,7 +208,7 @@ decomposable search problem $f$ and the resulting dynamic data structure $D$:}
\:
$
\bar
I
_
D
(
n
)
$
is
{
\I
amortized
}
time complexity of insertion to
$
D
$
.
\endlist
We assume that
$
Q
_
S
(
n
)
$
,
$
B
_
S
(
n
)/
n
$
,
$
S
_
S
(
n
)/
n
$
are all nondecreasing functions.
We assume that
$
Q
_
S
(
n
)
$
,
$
B
_
S
(
n
)/
n
$
,
$
S
_
S
(
n
)/
n
$
are all non
-
decreasing functions.
We decompose the set
$
X
$
into blocks
$
B
_
i
$
such that
$
|B
_
i|
\in
\{
0
,
2
^
i
\}
$
such that
$
\bigcup
_
i B
_
i
=
X
$
and
$
B
_
i
\cap
B
_
j
=
\emptyset
$
for all
$
i
\neq
...
...
@@ -239,7 +239,7 @@ Now let us calculate the space complexity of $D$.
For
$
|X|
=
n
$
let
$
I
=
\{
i
\mid
B
_
i
\neq
\emptyset\}
$
. Then for each
$
i
\in
I
$
we store a static data structure
$
S
$
with
$
2
^
i
$
elements contained in this
block. Therefore,
$
Q
_
D
(
n
)
=
\sum
_{
i
\in
I
}
Q
_
S
(
2
^
i
)
$
. Since
$
S
_
S
(
n
)
$
is
assumed to be nondecreasing,
assumed to be non
-
decreasing,
$$
\sum
_{
i
\in
I
}
Q
_
S
(
2
^
i
)
\leq
\sum
_{
i
\in
I
}
{
Q
_
S
(
2
^
i
)
\over
2
^
i
}
\cdot
2
^
i
...
...
@@ -249,7 +249,7 @@ $$
\qed
It might be advantageous to store the elements in each block separately so that
we do not have to inspect the static structure and extrac
e
the elements from
we do not have to inspect the static structure and extrac
t
the elements from
it, which may take additional time.
An insertion of
$
x
$
will act like an addition of 1 to a binary number. Let
$
i
$
...
...
@@ -265,7 +265,7 @@ TODO image
\proof
{
Since the last creation of
$
B
_
i
$
there had to be least
$
2
^
i
$
insertions. Amortized over one element this cost is
$
B
_
S
(
2
^
i
)
/
2
^
i
$
.
As this function is nondecreasing, we can lower bound it by
$
B
_
S
(
n
)
/
As this function is non
-
decreasing, we can lower bound it by
$
B
_
S
(
n
)
/
n
$
. However, one element can participate in
$
\log
n
$
rebuilds during
the structure life. Therefore, each element needs to store up cost
$
\log
n
\cdot
B
_
S
(
n
)
/
n
$
to pay off all rebuilds.
...
...
@@ -322,7 +322,7 @@ queries. No such block contains a duplicate element and union of all complete
blocks contains the whole set
$
X
$
.
Next let
$
B
_
i
^
*
$
be a block in construction. Whenever two blocks
$
B
_
i
^
a, B
_
i
^
b
$
of same rank
$
i
$
meet, we will imm
i
diately start building
$
B
_{
i
+
1
}^
*
$
using
of same rank
$
i
$
meet, we will imm
e
diately start building
$
B
_{
i
+
1
}^
*
$
using
elements from
$
B
_
i
^
a
\cup
B
_
i
^
b
$
.
This construction will require
$
2
^{
i
+
1
}$
...
...
@@ -331,7 +331,7 @@ we finish $B_{i+1}^*$, we add it to the structure as one of the three full
blocks and finally remove
$
B
_
i
^
a
$
and
$
B
_
i
^
b
$
.
We will show that, using this scheme, this amount of blocks is enough to
bookkeep the structure.
book
-
keep the structure.
\lemma
{
At any point of the structure's life, for each rank
$
i
$
, there are at most
...
...
@@ -353,7 +353,7 @@ together and no block of rank $i+1$ in construction.
\qed
An insertion is now done by simply creating new block
$
B
_
0
$
. Next, we
additionaly run one step of construction for each
$
B
_
j
^
*
$
. There may be up to
additional
l
y run one step of construction for each
$
B
_
j
^
*
$
. There may be up to
$
\log
n
$
blocks in construction.
\theorem
{
...
...
@@ -395,7 +395,7 @@ keep a pointer on its instance in the BST. When we build a new block, we can
update all its current elements in the tree in constant time (and insert the
new one in logarithmic time).
Insertion time complexity then will always take at least logaritmic time and
Insertion time complexity then will always take at least logarit
h
mic time and
space requirements increase by the BST.
Deletion then finds an element in the BST, locates it in the corresponding
...
...
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