From b2eb347c5b4b5b8d835f5b4be607065454d36f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kon=C4=8Dick=C3=BD?= <koncicky@kam.mff.cuni.cz> Date: Sun, 11 Apr 2021 19:14:21 +0200 Subject: [PATCH] Dynamization: Full dynamization --- vk-dynamic/dynamic.tex | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/vk-dynamic/dynamic.tex b/vk-dynamic/dynamic.tex index 4753d1b..21314a7 100644 --- a/vk-dynamic/dynamic.tex +++ b/vk-dynamic/dynamic.tex @@ -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 -- GitLab