title: Taking binary tree as input(recursively)
body: <p>I am supposed to take input of a binary tree recursively as :</p>
  
  <p>10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false false</p>
  
  <p>so the tree created should be:-</p>
  
  <pre><code>        10
      20      30 
   40   50  60   73
  </code></pre>
  
  <p>I have created a function which cannot create this tree, whats wrong in the code?</p>
  
  <pre><code>node* takeInput() {
      int data;
      string a;
  
      cin&gt;&gt;data&gt;&gt;a;
      node*n = NULL;
  
      if(a=="true") {
          n = new node(data);
          n-&gt;left = takeInput();
          n-&gt;right = takeInput();
      }
      if(a=="false") {
         return NULL;
      }
      return n;
  }
  </code></pre>