\begin{algorithm} \caption{算法的标题} \label{alg:framwork} % 给算法一个标签,以便其它地方引用该算法 \begin{algorithmic}[1] % 数字 "1" 表示为算法显示行号的时候,每几行显示一个行号,如:"1" 表示每行都显示行号,"2" 表示每两行显示一个行号,也是为了方便其它地方的引用 \REQUIRE ~~\\ % 算法的输入参数说明部分 The set of positive samples for current batch, $P_n$; \\ The set of unlabelled samples for current batch, $U_n$; \\ Ensemble of classifiers on former batches, $E_{n-1}$; \ENSURE ~~\\ % 算法的输出说明 Ensemble of classifiers on the current batch, $E_n$; \STATE Extracting the set of reliable negative and/or positive samples $T_n$ from $U_n$ with help of $P_n$; \label{code:fram:extract} % 算法的具体描述,也可以给具体的算法行给定标签,方便其它部分对它的引用 \STATE Training ensemble of classifiers $E$ on $T_n \cup P_n$, with help of data in former batches; \label{code:fram:trainbase} \STATE $E_n = E_{n-1} \cup E$; \label{code:fram:add} \RETURN $E_n$; % 算法的返回值
\end{algorithmic} \end{algorithm}
• for 循环的使用例子 ∘ 例子, for 格式 \FOR {each $i \in [1,9]$} \STATE initialize a tree $T_{i}$ with only a leaf (the root); \\ \STATE $T = T\bigcup $_{i};$ \\ \ENDFOR