title: Depth First Search Algorithm - counting connected components
body: <p>Hi guys I have question and need help.Maybe it's offtopic but I've already posted it on Code Review but noones answers. I've written this using pseudocode, and I am stuck.I should examine if number of Vertices in one conected component is even. My idea is to implement DFS and to put one counter and then to check whether counter%2==0 is or not. My problem is I don't know where to put counter.
  Let's say DFS: is main method.</p>
  
  <p>G = (V,E) V- vertices, E-edges
  s-start point(vertex)</p>
  
  <pre><code>DFS(G,s):
  boolean result &lt;-- false
  Discovered[v] &lt;-- false for all Vertices V(v)
  DFS1(G,s)
  if (DFS1(G,u) % 2==0)
  result  &lt;-- true
  
  
  DFS1(G,u):
  Discovered[u] &lt;-- true
  // counter ++            But where I should initialize it??
  foreach Edge (v,u) incident to u
  if !Discovered[v]
  DFS1(G,v)`
  </code></pre>