From 10243df733f750d107961911c2df60bd22de7ec4 Mon Sep 17 00:00:00 2001 From: Martin Mares <mj@ucw.cz> Date: Fri, 21 Feb 2020 17:06:57 +0100 Subject: [PATCH] Cache: Clarified the argument by number of children --- 05-cache/cache.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/05-cache/cache.tex b/05-cache/cache.tex index c4afb19..6e55458 100644 --- a/05-cache/cache.tex +++ b/05-cache/cache.tex @@ -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 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. -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 only redistribute work and they do not touch items. So every node takes $\O(1)$ time and the -- GitLab