Can you tell me why I am not getting any output for my code
//#include “bits/stdc++.h”;
using namespace std;
class Node{
public:
int data;
Node * left;
Node * right;
Node(int d){
d=data;
left=NULL;
right=NULL;
}
};
Node * createTree(int *pre, int *inorder, int s,int e){
static int i=0;
if(s>e){
return NULL;
}
Node * root= new Node(pre[i]);
int index=-1;
for(int j=s;j<e+1;j++){
if(pre[i]==inorder[j]){
index=j;
break;
}
i++;
}
root->left=createTree(pre,inorder,0,index-1);
root->right=createTree(pre,inorder,index,e);
return root;
}
void printStyle(Node *root)
{
if(root==NULL)
return ;
if(root->left==NULL)
cout<<“END => “;
else
cout<left->data<<” => “;
cout<data;
if(root->right==NULL)
cout<<” <= END”<<endl;
else
cout<<" <= "<right->data<<endl;
printStyle(root->left);
printStyle(root->right);
}
int main() {
int n,m;
cin>>n;
int pre[n];
for(int i=0;i<n;i++){
cin>>pre[i];
}
cin>>m;
int inorder[m];
for(int j=0;j<n;j++){
cin>>inorder[j];
}
Node *root= createTree(pre,inorder,0,n-1);
printStyle(root);
return 0;
}