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;
noderight;
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() {
}