title: Searching a string in a binary tree in c
body: <p>I am a student of computer science, and I had an exam last week in C.</p>
  
  <p>One of the questions was to search a specific word (string) in a binary tree, and count how many times it appears.</p>
  
  <p>Every node in the tree contains a letter.</p>
  
  <p>For example, if the word is "mom", and the tree looks like the attached image, the function should return 2.
  Pay attention that if there is a word like this — "momom" — the function will count the "mom" only one time.</p>
  
  <p>I have not been able to solve this question.  Can you help?</p>
  
  <p><img src="https://i.stack.imgur.com/pLm7Z.jpg" alt="The example of tree"></p>
  
  <pre><code>     a
      / \
    b    m
   /    / \
  v    o   o
      / \   \
     m   t   m
  </code></pre>