title: How to make a binary tree with unique indexes in F#
body: <p>How do you write a recursive function to build a binary tree where leafs are (value,index) with index a unique successive integer?</p>
  
  <p>Current code is something like:</p>
  
  <pre><code>let rec MakeTree size = 
      if size = 0 then 0 else
        match ran.Next (3) with
         | 0 -&gt; Cow (MakeTree (size-1),MakeTree (size-1))
         | 1 -&gt; Dog (MakeTree (size-1),MakeTree (size-1))
         | 2 -&gt; Cat (MakeTree (size-1),MakeTree (size-1))
  </code></pre>