title: Delete a file tree if it is full using C
body: <p>Write a C program to Delete a Tree.</p>
  
  <p>I have written a small snippet of code to achieve this, but it goes into an infinite loop</p>
  
  <pre><code>void deleteTree(struct tnode *root)
  {
   cout&lt;&lt;root-&gt;data&lt;&lt;endl;
   if( root-&gt;lchild == NULL &amp;&amp; root-&gt;rchild == NULL)
     delete(root);
  
   deleteTree(root-&gt;lchild);
   deleteTree(root-&gt;rchild);
   //return root;
  }  
  </code></pre>
  
  <p>I want to delete it while traversing. I know that Post Order Traversal can be used. But some other idea can be there or not?</p>