title: How to predict StackOverFlow?
body: <p>Imagine that you traverse a tree (not necessary binary, binary search or balanced one) in order to check if the given tree contains a particular item.</p>
  
  <p>The tree is presented by a number of nodes with the following structure:</p>
  
  <pre><code>public class TreeNode&lt;V&gt; {
     private V value;
     private Collection&lt;TreeNode&lt;V&gt;&gt; children;
  }
  </code></pre>
  
  <p>So, you traverse the given tree in recursive way.</p>
  
  <p>What will be an approximate size of the tree (number of nested children) when StackOverFlow exception is thrown?</p>
  
  <p>How to predict StackOverFlow in this case?</p>