dvipdfm -o $@ -p a4 -r 600 -z 9 $<
mostlyclean:
- rm -f *.dvi *.log *~ core *.o *.aux *.bbl *.blg *.ids
+ rm -f *.dvi *.log *~ core *.o *.aux *.bbl *.blg *.ids *.toc
clean: mostlyclean
rm -f *.ps *.pdf
%--------------------------------------------------------------------------------
-\section{A~randomized algorithm}\id{randmst}%
+\section{A randomized algorithm}\id{randmst}%
When we analysed the contractive Bor\o{u}vka's algorithm in Section~\ref{contalg},
we observed that while the number of vertices per iteration decreases exponentially,
%--------------------------------------------------------------------------------
-\section{Dynamic MSF}
+\section{Dynamic spanning forests}
Let us turn our attention back to the dynamic MSF now.
Most of the early algorithms for dynamic connectivity also imply $\O(n^\varepsilon)$
\thmcount=0
\def\currentid{??}
-\def\chapter#1{\vfill\supereject
-\advance\chapcount by 1
+\def\rawchapter#1{\vfill\supereject
+\leftline{\chapfont #1}
+\bigskip
+}
+
+\def\chapter#1{\advance\chapcount by 1
\seccount=0
\thmcount=0
\footcnt=0
\edef\currentid{\the\chapcount}
-\leftline{\chapfont\currentid. #1}
-\bigskip
+\rawchapter{\currentid. #1}
+\writetoc{chap}{#1}
}
\def\section#1{\bigskip
\thmcount=0
\edef\currentid{\the\chapcount.\the\seccount}
\leftline{\secfont\currentid. #1}
+\nobreak
\medskip
+\nobreak
+\writetoc{sec}{#1}
}
\def\para{\advance\thmcount by 1
\def\proof{\noindent {\sl Proof.}\enspace}
\def\proofsketch{\noindent {\sl Proof sketch.}\enspace}
+%%% Table of contents %%%
+
+\newwrite\toc
+\immediate\openout\toc=\jobname.toc
+\newif\iftoc
+\tocfalse
+
+\def\writetoc#1#2{
+ \toctrue
+ \toks0={\the\count0}
+ \edef\tocaux{\write\toc{\noexpand\expandafter\noexpand\string\noexpand\csname toc#1\noexpand\endcsname{\currentid}{#2}{\the\toks0}}}
+ \tocaux
+ \tocfalse
+}
+
+\def\includetoc{
+\immediate\closeout\toc
+\input \jobname.toc
+}
+
+\def\tocchap#1#2#3{\smallskip\line{\bo #1.~~#2 \dotfill ~#3}}
+\def\tocsec#1#2#3{\line{#1.~~#2 \dotfill ~#3}}
+
%%% References %%%
\newwrite\ids
%--------------------------------------------------------------------------------
-\section{Ranking of {\secitfont k\/}-permutations}
+\section{Ranking of \iftoc $k$\else{\secitfont k\/}\fi-permutations}
\id{kpranksect}
The technique from the previous section can be also generalized to lexicographic ranking of
\chapter{Bibliography}
\dumpbib
+\rawchapter{Table of contents}
+\includetoc
+
\bye