Structurally identical

In the below code I’m not able to give the input.can you modify my code.
#include
#include
using namespace std;
class node{
public:
int data;
nodeleft;
node
right;

node(int d){
	data=d;
	left=NULL;
  right=NULL;
}

};
nodeinsert(node root,int data){
if(root==NULL){
return new node(data);
}
if(data<=root->data){
root->left=insertInBST(root->left,data);
}
else{
root->right=insertInBST(root->right,data);
}
return root;
}
node* build(){
int d;
cin>>d;
noderoot=NULL;
while(d!=-1){
root=insert(root,d);
cin>>d;
}
return root;
}
bool struct(node
root1,node* root2){
if(root1==NULL && root2==NULL){
return true;
}
else if(root1==NULL || root2==NULL){
int leftt=struct(root1->left,root2->left)
int rightt=struct(root1->right,root2->right)
return leftt and rightt;
}
return false;
}

int main() {

}

hi @dips123deepali_c25f140838182212
Refer this -->
https://ide.codingblocks.com/s/647321?_ga=2.2318770.326747640.1641824358-62531247.1625483271

Can you pls explain the algo for void build tree

Try to dry run the code on sample input… it will give u better insight…

hi @dips123deepali_c25f140838182212
is there anything else??

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.