]> mj.ucw.cz Git - saga.git/commitdiff
SH: Optimality.
authorMartin Mares <mj@ucw.cz>
Sat, 29 Mar 2008 19:11:23 +0000 (20:11 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 29 Mar 2008 19:11:23 +0000 (20:11 +0100)
opt.tex

diff --git a/opt.tex b/opt.tex
index 5b2d0d43d0bd365812148cfaf22fb662a882e53a..7ffcac355da706f89e0b4db05e66616f54a9d7cc 100644 (file)
--- a/opt.tex
+++ b/opt.tex
@@ -493,13 +493,21 @@ We set the parameter~$r$ to~$2+2\lceil\log (1/\varepsilon)\rceil$. The rest foll
 from the analysis above. By Lemma \ref{shcorrlemma}, there are always at most $n/2^{r-2}
 \le \varepsilon n$ corrupted items in the heap. By Lemma \ref{shmeld}--\ref{shyards},
 the time spent on all operations in the sequence can be paid for by charging $\O(r)$ time
-against each \<Insert>, which yields the time bound.
+against each \<Insert>. This yields the time bound.
 \qed
 
-\FIXME{Christen lemmata.}
-
-\FIXME{Remark on optimality.}
-
+\rem
+When we set $\varepsilon = 1/2n$, the soft heap is not allowed to corrupt any
+items, so it can be used like any usual heap. By the standard lower bound on
+sorting it therefore requires $\Omega(\log n)$ time per operation, so the
+time complexity is optimal for this choice of~$\varepsilon$. Chazelle \cite{chazelle:softheap}
+proves that it is optimal for every choice of~$\varepsilon$.
+
+The space consumed by the heap need not be linear in the \em{current} number
+of items, but if a~case where this matters ever occured, we could fix it easily
+by rebuilding the whole data structure completely after $n/2$ deletes. This
+increases the number of potentially corrupted items, but at worst twice, so it
+suffices to decrease~$\varepsilon$ twice.