title: Creating and printing binary tree from array
body: <p>I am trying to create a binary tree with the array as defined in my function.</p>
  
  <p>I then then want to print its elements in inorder fashion (root, left, right)</p>
  
  <p>The following code compiles but gives no input (NULL)</p>
  
  <p>Please tell me where am I going wrong</p>
  
  <pre><code>struct BST{
      int data;
      struct BST *left;
      struct BST *right;
  };
  
  struct BST *in(int data, struct BST *p1, struct BST *p2);
  struct BST *create_BST(int a[], int i, int size);
  void inorder(struct BST *tree);
  int  main(void){
      struct BST *root;
      int a[]={7, 10, 14, 5, 9, 11, 4, 13, 6};
  
  
      root=create_BST(a,0,9);
  
      printf("\nPrinting Tree:\t");
      inorder(root);
      return 0;
  
  }
  void inorder(struct BST *root){
      if(root!=NULL){
          inorder(root-&gt;left);
          printf("%d",root-&gt;data);
          inorder(root-&gt;right);
      }
  }
  
  struct BST *in(int data, struct BST *p1, struct BST *p2){
      struct BST *t;
      t=(struct BST*)malloc(sizeof(struct BST));
      t-&gt;data=data;
      t-&gt;left=p1;
      t-&gt;left=p2;
      return t;
  }
  
  struct BST *create_BST(int a[], int i, int size){
  
      if(i&gt;=size){
          return NULL;
      }else{
          return(in(a[i],create_BST(a,2*i + 1,size),
              create_BST(a,2*i + 2,size)));
      }
  
  }
  </code></pre>