title: Postfix to Infix with minimum number of parentheses
body: <p>I am looking for algorithm postfix to infix notation which will produce the minimum number of the parentheses. </p>
  
  <p>I have found that but it will produce many, many parentheses: <a href="http://tajendrasengar.blogspot.com/2011/09/postfix-to-infix-algorithm.html" rel="nofollow">http://tajendrasengar.blogspot.com/2011/09/postfix-to-infix-algorithm.html</a></p>
  
  <p><strong>For example</strong></p>
  
  <p>The input:</p>
  
  <pre><code>&lt;ONP&gt;abcd*/+~
  </code></pre>
  
  <p>The result:</p>
  
  <pre><code>&lt;INF&gt;~(a+b/(c*d))
  </code></pre>