title: Possible permutations of BST's input
body: <p>I am given a string, i.e. "CPHBDZ". By inserting (in this order) letters to a BST I will have:</p>
  
  <pre><code>  C
   / \
  B   P
     / \
    H   Z
   /
  D
  </code></pre>
  
  <p>If we change order of the string to "CBPHDZ" we will get identical tree. 
  And I have to find and list all permutations of the input string that provide the same BST. I came up with how to calculate a number of those permutations but I can't figure out any algorithm which actually finds them.</p>