This is my latex code :



\title{Euclid's Algorithm: An example of how to write algorithms in \LaTeX{}}



\section{Notations,Definitions and Symbols}

\item $n$ is the number of vertice in a input graph $G$.

\item $S$ repersents implicit stack of size $n$.
\item $S'_{1}$ and $S'_{2}$ are the top two segments of stack $S$
\item $S'$ is explicit stack that contain $S'_1$ and $S'_2$, where size of both is $\Theta(\frac{n}{\ log n})$ many entries.
\item $D$ is a hash table.
\item $T$ is a trailer stack.

\section{Example Algorithm}

Algorithms can be included using the commands as shown in algorithm \ref{alg:euclid}.

\For{\texttt{i:=1 to n}}
        \State \texttt{color[i]:= white }
\STATE <Create a stack $S'$>



I am getting, why \STATE <Create a stack $S'$> is not working.


I assume this is about the Undefined control sequence error this throws. It does that because, well, \STATE isn't a defined control sequence here. But the command \State, which you also use, is, so use that.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.