# Dynamization

In computer science, dynamization is the process of transforming a static data structure into a dynamic one. Although static data structures may provide very good functionality and fast queries, their utility is limited because of their inability to grow/shrink quickly, thus making them inapplicable for the solution of dynamic problems, where the input data changes. Dynamization techniques provide uniform ways of creating dynamic data structures.

## Decomposable search problems

We define problem ${\displaystyle P}$ of searching for the predicate ${\displaystyle M}$ match in the set ${\displaystyle S}$ as ${\displaystyle P(M,S)}$. Problem ${\displaystyle P}$ is decomposable if the set ${\displaystyle S}$ can be decomposed into subsets ${\displaystyle S_{i}}$ and there exists an operation ${\displaystyle +}$ of result unification such that ${\displaystyle P(M,S)=P(M,S_{0})+P(M,S_{1})+\dots +P(M,S_{n})}$.

## Decomposition

Decomposition is a term used in computer science to break static data structures into smaller units of unequal size. The basic principle is the idea that any decimal number can be translated into a representation in any other base. For more details about the topic see Decomposition (computer science). For simplicity, binary system will be used in this article but any other base (as well as other possibilities such as Fibonacci numbers) can also be utilized.

If using the binary system, a set of ${\displaystyle n}$ elements is broken down into subsets of sizes with

${\displaystyle 2^{i}*n_{i}}$

elements where ${\displaystyle n_{i}}$ is the ${\displaystyle i}$-th bit of ${\displaystyle n}$ in binary. This means that if ${\displaystyle n}$ has ${\displaystyle i}$-th bit equal to 0, the corresponding set does not contain any elements. Each of the subset has the same property as the original static data structure. Operations performed on the new dynamic data structure may involve traversing ${\displaystyle \log _{2}\left(n\right)}$ sets formed by decomposition. As a result, this will add ${\displaystyle O(\log \left(n\right))}$ factor as opposed to the static data structure operations but will allow insert/delete operation to be added.

Kurt Mehlhorn proved several equations for time complexity of operations on the data structures dynamized according to this idea. Some of these equalities are listed.

If

• ${\displaystyle P_{S}\left(n\right)}$ is the time to build the static data structure
• ${\displaystyle Q_{S}\left(n\right)}$ is the time to query the static data structure
• ${\displaystyle Q_{D}\left(n\right)}$ is the time to query the dynamic data structure formed by decomposition
• ${\displaystyle {\overline {I}}}$ is the amortized insertion time

then

• ${\displaystyle Q_{D}\left(n\right)=O\left(Q_{S}\left(n\right)\cdot \log \left(n\right)\right)}$
• ${\displaystyle {\overline {I}}=O\left(\left(P_{S}\left(n\right)/n\right)\cdot \log \left(n\right)\right).}$

If ${\displaystyle Q_{S}\left(n\right)}$ is at least polynomial, then ${\displaystyle Q_{D}\left(n\right)=O\left(Q_{S}\left(n\right)\right)}$.