title: Post-order/Pre-order Traversal of Binary Tree
body: <p>I have a pre-order traversal function that looks like this:</p>
  
  <pre><code>void listInPreOrder(node* hd){
  if(hd != NULL) {
          printf("%d, ", hd-&gt;value);
          listInPreOrder(hd-&gt;left);
          listInPreOrder(hd-&gt;right);
      }
  }
  </code></pre>
  
  <p>That in fact works, but I thought that making it post order would be as simple as this</p>
  
  <pre><code>void listInPostOrder(node* hd){
  if(hd != NULL) {
          listInPreOrder(hd-&gt;left);
          listInPreOrder(hd-&gt;right);
          printf("%d, ", hd-&gt;value);
      }
  }
  </code></pre>
  
  <p>But unfortunately it does not work so well. I'm wondering how to fix this, maybe I'm doing something simple wrong. Or maybe it's completely wrong. </p>