0

This is my latex code :

\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}

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

\author{write\LaTeX{}}

\date{\today}

\begin{document}
\maketitle
\section{Notations,Definitions and Symbols}

\begin{itemize}
{
\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.
}
\end{itemize}



\section{Example Algorithm}

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

\begin{algorithm}
\caption{DFS}\label{alg:dfs}
\begin{algorithmic}[1]
\For{\texttt{i:=1 to n}}
        \State \texttt{color[i]:= white }
      \EndFor
\STATE <Create a stack $S'$>


\end{algorithmic}
\end{algorithm}

\end{document}

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

1

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.

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.