Merge pull request #38 from Linkus000/master

Change arrays indicating visitiveness of nodes to bool[] from int[] in dfs,bfs
This commit is contained in:
pllk 2017-04-17 12:41:34 +03:00 committed by GitHub
commit 086d0e61cd
1 changed files with 3 additions and 2 deletions

View File

@ -133,7 +133,7 @@ vector<int> v[N];
\end{lstlisting} \end{lstlisting}
and also maintains an array and also maintains an array
\begin{lstlisting} \begin{lstlisting}
int z[N]; bool z[N];
\end{lstlisting} \end{lstlisting}
that keeps track of the visited nodes. that keeps track of the visited nodes.
Initially, each array value is 0, Initially, each array value is 0,
@ -323,7 +323,8 @@ of the queue is the next node to be processed.
In addition, the code uses arrays In addition, the code uses arrays
\begin{lstlisting} \begin{lstlisting}
int z[N], e[N]; bool z[N];
int e[N];
\end{lstlisting} \end{lstlisting}
so that the array \texttt{z} indicates so that the array \texttt{z} indicates
which nodes the search has already visited which nodes the search has already visited