title: Inorder traversal of expression tree in java
body: <p>I am creating inorder traversal of expression tree but it is not considering the middle element. Below is my code. Can you please let me know where i am wroong and code i have missed.
  e.g if the prefix notation of expression tree is  * 1 + 2 3 then the output of inorder tree along with paranthesis should be (1+(2*3)) but i am getting output (1(23)+)*        </p>
  
  <pre><code>public String toStringPrettyInFix(){
  
      return printInorder(root)+")";
  
  }
  
  String printInorder(FCNSTreeNode root)
  {
  
      String s="";
      if (root == null)
          return "";
  
      if(root.firstChild!=null) {
  
  
          s=s+"("+printInorder(root.firstChild);
  
      }     
  
  
  
      if(root.nextSibling!=null) {
          s=s+printInorder(root.nextSibling)+")";
  
      }
  
  
  System.out.println(s);
  
      return s;
  
  }
  </code></pre>