title: Printing an Abstract Syntax Tree
body: <p>I am attempting to use an Abstract Syntax Tree to take a Reverse Polish Notation equation and change it to its equivalent infix form. Below is the structure of the AST and the <code>print_table</code> we had originally used to print a tree. </p>
  
  <pre><code>struct tnode {
    char *datum;
    struct tnode *left;
    struct tnode *right;
  };
  
  void print_table(struct tnode *AST) {
    if(AST != NULL) {
      print_table(AST-&gt;left);
      printf("%s", AST-&gt;datum);
      print_table(AST-&gt;right);
    }
  }
  </code></pre>
  
  <p>However, this prints the tree from the top down. For example, if given <code>5 4 + 3 -</code>, it will return <code>-3+45</code>. What I want for it to print is <code>5+4-3</code>, essentially printing the left most child, then it's parent node, and the right child of that parent node until all elements of the tree have been printed.
  How might I go about doing this?</p>