Skip to content
Snippets Groups Projects
Commit 10243df7 authored by Martin Mareš's avatar Martin Mareš
Browse files

Cache: Clarified the argument by number of children

parent 52f63cca
No related branches found
No related tags found
No related merge requests found
...@@ -268,7 +268,8 @@ To establish time and I/O complexity, we consider the tree of recursion. Every n ...@@ -268,7 +268,8 @@ To establish time and I/O complexity, we consider the tree of recursion. Every n
to a~T or TS problem. It has 3 or~4 children for its sub-problems. At level~$i$ (counted from the to a~T or TS problem. It has 3 or~4 children for its sub-problems. At level~$i$ (counted from the
root, which is at level~0), we have at most $4^i$ nodes with sub-problems of size $N/2^i$. root, which is at level~0), we have at most $4^i$ nodes with sub-problems of size $N/2^i$.
Therefore, the height of the tree is $\log N$ and it has $4^{\log N} = N^2$ leaves. Therefore, the height of the tree is $\log N$ and it has $4^{\log N} = N^2$ leaves.
Since all internal nodes have at least 2~children, there are less internal nodes than leaves. Since all internal nodes have least 2~children (in fact, 3 or~4), there are
less internal nodes than leaves.
In every TS leaf, we swap a~pair of items. In every T~leaf, nothing happens. Internal nodes In every TS leaf, we swap a~pair of items. In every T~leaf, nothing happens. Internal nodes
only redistribute work and they do not touch items. So every node takes $\O(1)$ time and the only redistribute work and they do not touch items. So every node takes $\O(1)$ time and the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment