我正在读计算机科学纸现在,我真的很喜欢伪代码的显示方式。但是,我不确定这是哪个伪代码包。任何帮助都将不胜感激。图片如下:
答案1
您可以使用algorithm2e
包裹:
\documentclass{article}
\usepackage[procnumbered,noline]{algorithm2e}
\makeatletter
\renewcommand\theAlgoLine{\two@digits{\arabic{AlgoLine}}}
\makeatother
\SetNlSty{normalfont}{}{.}
\SetNlSkip{-10pt}
\SetInd{1em}{2em}
\newcommand\nld{\SetNlSty{normalfont}{}{\hphantom{.}}\nl}
\SetKw{melse}{else,}
\begin{document}
\begin{procedure}
\SetKwProg{myproc}{Procedure}{}{}
\myproc{improve-approx-2(r,S,T)}{
\nl $\Delta=r(S,T)$\;
\nl let $c$ be the number of $\Delta$-critical nodes\;
\nl\uIf{$c>m^{9/16}$}{\nld find a $\Delta/(4m)$-optimal flow}
\nl\melse\uIf{$m^{1/3}<c<m^{9/16}$}{\nld let $G'$ denote $\Delta$-compact network}
}
\end{procedure}
\end{document}