% Sazba algoritmu:
% \algo
+% \algin popis vstupu
% \:krok
% \:krok
% \::vnoreny krok
+% \algout pop
% \endalgo
\def\algo{
\interlistskip
\begingroup
\let\:=\algoitem
-\let\*=\algohang
\parskip=1pt plus 1pt minus 0.3pt
\rightskip=2em
\itemcount=0
}
\def\endalgo{\interlistskip\endgroup}
-\def\algoitem{\par
+\def\algopar{\par
\parindent=2em
\hangindent=4em
\hangafter=1
-\advance\itemcount by 1
-\leavevmode\hbox to 2em{\hss \the\itemcount. }%
+\leavevmode
+}
+\def\algoitem{\algopar\advance\itemcount by 1
+\hbox to 2em{\hss \the\itemcount. }%
\futurelet\next\algoitemh}
\def\algoitemh{\ifx\next:\let\next=\algohang\else\let\next=\relax\fi\next}
\def\algohang:{\advance\hangindent by 2em \hskip 2em\futurelet\next\algoitemh}
+\def\algin{\:{\I Vstup:} }
+\def\algout{\:{\I Výstup:} }
% Nekolikapismenkova promenna (mozno pouzit v textovem i math modu)
-\def\<#1>{\hbox{\it #1\/}}
+\def\<#1>{\leavevmode\hbox{\it #1\/}}
% Asymptoticke O-cko
\def\O{{\cal O}}
% Blackboard bold font
\newfam\bbfam
\font\bbten=bbold10
+\font\bbseven=bbold7
+\font\bbfive=bbold5
\textfont\bbfam=\bbten
+\scriptfont\bbfam=\bbseven
+\scriptscriptfont\bbfam=\bbfive
\def\bb{\bbten\fam\bbfam}
% Reference na konci kapitoly