diff --git a/bib/bibliography.bib b/bib/bibliography.bib index 9333dfb70b5a146e58b5c38d75962cae2ca084f0..436c3dc79c3457fe1de846e8402c09fe7aee7a61 100644 --- a/bib/bibliography.bib +++ b/bib/bibliography.bib @@ -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" +} diff --git a/vk-dynamic/dynamic.tex b/vk-dynamic/dynamic.tex index 21314a73cf6893c0dbe911089a69ea299756b38e..a34287e2d8d6bdf6c1afd7f1c5aa61bd84fc6149 100644 --- a/vk-dynamic/dynamic.tex +++ b/vk-dynamic/dynamic.tex @@ -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 inbalance a root of a perfectly balanced trees, and thus cause +nodes by one. To unbalance 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 extrace the elements from +we do not have to inspect the static structure and extract 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 immidiately start building $B_{i+1}^*$ using +of same rank $i$ meet, we will immediately 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 +additionally 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 logarithmic time and space requirements increase by the BST. Deletion then finds an element in the BST, locates it in the corresponding