Skip to content
Snippets Groups Projects
Commit b2eb347c authored by Václav Končický's avatar Václav Končický
Browse files

Dynamization: Full dynamization

parent b34e2144
No related branches found
No related tags found
No related merge requests found
......@@ -377,4 +377,38 @@ construction steps, each taking $B_S(2^i)/2^i$ time. Summing this
together, we get the required upper bound.
\qed
\subsection{Full dynamization}
For our definition of search problems, it is not easy to delete elements, as
anytime we wished to delete an element we would need to take apart and split a
structure into a few smaller ones. This could never be able to amortize to
decent deletion time.
Instead of that, we will want the underlying static structure to have an
ability to cross out elements. These elements will no longer participate in
queries, but they will count towards the structure size and complexity.
Once we have ability to cross out elements, we can upgrade the semidynamic data
structure to support deletion. We add a binary search tree or another set
structure which maps each element to a block it lives in. For each element we
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
space requirements increase by the BST.
Deletion then finds an element in the BST, locates it in the corresponding
block and crosses it out. We also keep the count of crossed out elements. If
this count becomes a certain fraction of all elements, we rebuild the structure
completely.
Before having to rebuild the whole structure, we cross-out at least $\Theta(n)$
elements, so the deletion time can be amortized and it will result in same time
complexity as insertion.
There also exists an worst-case version of full dynamization which carefully
manipulates with blocks, splitting and merging them as required. The details
are somewhat complicated, so we will not look at them further.
\endchapter
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment