title: Can't figure out this algorithm (recursive) on Trie operation
body: <p>Could someone help me understand the following pheudocode?  </p>
  
  <pre><code>countWords(vertex, word, missingLetters)  
      k=firstCharacter(word)  
      if isEmpty(word)  
          return vertex.words  
      else if notExists(edges[k]) and missingLetters=0  
          return 0  
      else if notExists(edges[k])  
          cutLeftmostCharacter(word)  
          return countWords(vertex, word, missingLetters-1)  
          //Here we cut a character but we don't go lower in the tree  
      else  
          //We are adding the two possibilities: the first  
          //character has been deleted plus the first character is present  
          r=countWords(vertex, word, missingLetters-1)  
          cutLeftmostCharacter(word)  
          r=r+countWords(edges[k], word, missingLetters)  
          return r    
  </code></pre>
  
  <p>The idea is that using a <a href="http://en.wikipedia.org/wiki/Trie" rel="nofollow">Trie</a> we are trying to find the number of times a word appears in our dictionary, BUT we may have missing letters.<br>
  I am lost in the <code>else</code> part.  I don't understand the logic.<br>
  For example if the first char of our word is a match we hit the last <code>else</code> and then recurse on <code>countWords</code> in the same level but with <code>missingLetters-1</code> but then isn't that an identical loop? I.e. it will compare again the first letter in the same level and so on?<br>
  Could someone please help me figure this out?</p>