title: Is there tree traversal algorithm with fixed memory usage?
body: <p>I have first node of the tree. Something like that:</p>
  
  <pre><code>class TreeNode {
     int uniqueValue;
     List&lt;TreeNode&gt; children;
  }
  </code></pre>
  
  <p>I want to find the most memory efficient way to print all nodes of the tree. Tree may be big or VERY BIG. It can be deep or wide. I know algorithms with recursion and with stack. What I want to find is algorithm that use fixed amount memory independently from graph size.</p>
  
  <p>Tree is NOT binary!</p>