Iam inserting a node in the tree, while inserting , after n = 1, no further allocation is being done rather the previously allocated nodes are getting overwritten.
tree = (Node**)realloc(tree, sizeof(Node*) * (2 * i + 1));
Since, for i=1, once indexes of the 1-D array (for index no 2 and 3) are filled and control goes into the else part, you are doing (2 * i + 1) = 3. This means you are not expanding your array further but re-allocating memory for already allocated nodes. If I understand correctly, you want to dynamically resize the array to accommodate more nodes. Please check on the same.
Moreover, you are also not using the memset operation correctly.