title: Given a BST and its root, print all sequences of nodes which give rise to the same bst
body: <p>Given a BST, find all sequences of nodes starting from root that will essentially give the same binary search tree.</p>
  
  <p>Given a bst, say</p>
  
  <pre><code>  3
   /  \
  1    5
  </code></pre>
  
  <p>the answer should be 3,1,5 and 3,5,1.</p>
  
  <p>another example</p>
  
  <pre><code>       5
       /   \
      4     7
     /     / \
    1     6   10
  </code></pre>
  
  <p>the outputs will be </p>
  
  <p>5,4,1,7,6,10</p>
  
  <p>5,4,7,6,10,1</p>
  
  <p>5,7,6,10,4,1</p>
  
  <p>etc</p>
  
  <p>The invariant here however is that the parent's index must always be lesser than its children. I am having difficulty implementing it.</p>