I have an algorithm which manipulates some local and global variables.
I don't know the format to declare global variables,
here I declared them in Require
before the Procedure
, However I think Require
is for input parameters
\begin{algorithm}
\caption{An Algorithm}
\begin{algorithmic}
\Require
\State
\State $A$, Global var1
\State $B$, global var2
\State $C$, global var3
\Procedure{Proc}{$input$}
\State $D$, local var
\State $A \gets B +D$
\EndProcedure
\end{algorithmic}
\end{algorithm}
Best Answer
You can define a new block: